Sniperbooya
Registered User.
- Local time
- Today, 08:32
- Joined
- Jan 30, 2015
- Messages
- 16
Hi Guys,
I have got an append query (Query_AppendTable_Bitumen_Gemiddelde)which adds data into a table.
The user selects 2 items from the list. When closing the form the 2 selected items will be added to Table "Bitumen_gemiddelde".
When manually running this query (double click) the query seems to work just fine. However, when adding a click event to a button and program it to the point where it automatically opens the query it only adds 1 of the selected items.
Query_Uncheck_selectie_gemiddelde unchecks the selected items.
I have tried using
'DoEvents' to buy the Query some more time to run properly. Unfortunately that did not help either.
Any ideas why this could happen?
Thanks a lot!
I have got an append query (Query_AppendTable_Bitumen_Gemiddelde)which adds data into a table.
The user selects 2 items from the list. When closing the form the 2 selected items will be added to Table "Bitumen_gemiddelde".
When manually running this query (double click) the query seems to work just fine. However, when adding a click event to a button and program it to the point where it automatically opens the query it only adds 1 of the selected items.
Code:
Private Sub okpopupselectietoetsgem_Click()
On Error GoTo Err_okpopupselectietoetsgem_Click
DoCmd.Close acForm, "popupselectietoets"
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.OpenQuery "Query_AppendTable_Bitumengemiddelde"
DoCmd.Close
DoCmd.OpenForm "Start"
DoCmd.OpenQuery "Query_Uncheck_selectie_gemiddelde"
Exit_okpopupselectietoetsgem_Click:
Exit Sub
Err_okpopupselectietoetsgem_Click:
MsgBox Err.Description
Resume Exit_okpopupselectietoetsgem_Click
End Sub
Query_Uncheck_selectie_gemiddelde unchecks the selected items.
I have tried using
'DoEvents' to buy the Query some more time to run properly. Unfortunately that did not help either.
Any ideas why this could happen?
Thanks a lot!