I have a number of queries that I'm trying to automate. The stickler is that one of the queries, a check of duplicates, opens so that the duplicates are displayed and can be deleted.
What I want to happen is that once that query is closed, it procedes with the rest of them. How do I do that? The first set of them are driven by a Click from a form, but I don't know how to get it to "Continue". (In my example, how to start up CmdFIT1qry3b() when qry03a_FindDUps_tblSourceFIT1 is finished)
Thanks! Here's what I've got:
What I want to happen is that once that query is closed, it procedes with the rest of them. How do I do that? The first set of them are driven by a Click from a form, but I don't know how to get it to "Continue". (In my example, how to start up CmdFIT1qry3b() when qry03a_FindDUps_tblSourceFIT1 is finished)
Thanks! Here's what I've got:
Code:
Option Compare Database
Option Explicit
Private Sub CmdLoadFIT1_Click()
On Error GoTo Err_CmdLoadFIT1_Click
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry01_Clear_tblSourceFIT1"
DoCmd.OpenQuery "qry02_AppendTo_tblSourceFIT1"
DoCmd.OpenQuery "qry03a_FindDUps_tblSourceFIT1", acViewNormal, acEdit
DoCmd.SetWarnings True
Exit_CmdLoadFIT1_Click:
Exit Sub
Err_CmdLoadFIT1_Click:
MsgBox Err.Description
Resume Exit_CmdLoadFIT1_Click
End Sub
Private Sub CmdFIT1qry3b()
On Error GoTo Err_CmdFIT1qry3b
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry03b_Corrections_tblSourceFIT1", acViewNormal, acEdit
DoCmd.OpenQuery "qry04_BatchPrefix_SMST", acViewNormal, acEdit
DoCmd.OpenQuery "qry05_BatchPrefix_SMSP", acViewNormal, acEdit
DoCmd.OpenQuery "qry06_BatchLoad_NonBillableAcctsFIT1"
DoCmd.SetWarnings True
Exit_CmdFIT1qry3b:
Exit Sub
Err_CmdFIT1qry3b:
MsgBox Err.Description
Resume Exit_CmdFIT1qry3b
End Sub