T. McConnell
Registered User.
- Local time
- Today, 02:27
- Joined
- Jun 21, 2019
- Messages
- 63
Hey all,
I am having an issue I have an append query that is to add new records to a table. The query is tied to a button that checks to see if a checkbox is checked and if so to run the append query. The problem is when I check the box and then click my Save button nothing is copied over, but if I go back into the record and re-save it again the data shows up. I have tried the below code but it only seems to work if I do it twice. The commented section out are the other ways I tried to run the query but same result each time. Any suggestions would be greatly appreciated.
MoveToInventory is the checkbox name and of course QryExpenseToInventory is my query which copies over certain fields to the OtherInventory table.
I have another query similar to this one based on the same button and both do the same, nothing shows up unless I run the save button again.
Thanks!
I am having an issue I have an append query that is to add new records to a table. The query is tied to a button that checks to see if a checkbox is checked and if so to run the append query. The problem is when I check the box and then click my Save button nothing is copied over, but if I go back into the record and re-save it again the data shows up. I have tried the below code but it only seems to work if I do it twice. The commented section out are the other ways I tried to run the query but same result each time. Any suggestions would be greatly appreciated.
MoveToInventory is the checkbox name and of course QryExpenseToInventory is my query which copies over certain fields to the OtherInventory table.
Code:
Private Sub btnSave_Click()
If Me.MoveToInventory.Value = True Then
'CurrentDb.Execute "QryExpenseToInventory"
'DoCmd.OpenQuery "QryExpenseToInventory", acNormal, acEdit
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryExpenseToInventory"
DoCmd.SetWarnings True
End If
End Sub
I have another query similar to this one based on the same button and both do the same, nothing shows up unless I run the save button again.
Thanks!