Hi. I have a command button click event which calls 2 INSERT INTO queries. The first query inserts a 'master' record and the second query inserts 'detail' records. When I click the button the first time it seems that only the first query executes, as I can see the 'master' records but not the 'detail' records. But if I click the button again I can then see the detail records. So basically I need to click the button twice in order to have both queries complete successfully.
I thought that this issue may be related to the fact that the 2nd query was executing too soon before the first 'master' record was created. Therefore I added a 5 second timer between the 2 queries, but I received the same results and still needed to click the button twice.
Any ideas how I can work around this problem? Thanks!
--
Not until I became a Network Administrator did the error message "See your Network Administrator for assistance" become petrifying.
I thought that this issue may be related to the fact that the 2nd query was executing too soon before the first 'master' record was created. Therefore I added a 5 second timer between the 2 queries, but I received the same results and still needed to click the button twice.
Any ideas how I can work around this problem? Thanks!
Code:
Private Sub cmdDebitMemo_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryConvertPOToCM" 'create master
DoCmd.OpenQuery "qryConvertPOToCMDetail" 'create detail
DoCmd.SetWarnings True
End Sub
--
Not until I became a Network Administrator did the error message "See your Network Administrator for assistance" become petrifying.