H
h2fcell
Hello,
In Access 2007, I’m having a little issue displaying a form that runs
queries on load. Below is my code.
When I double click the form, the queries begin to run but the form only
appears after the queries are done.
If I put the code behind a command button it works fine. I can’t use a
command button because I need the queries to run unattended when the DB
opens. Where am I going wrong?
Private Sub Form_Open(Cancel As Integer)
DoCmd.MoveSize 2880, 4320
End Sub
Private Sub Form_Load()
DoCmd.SetWarnings False
'**********************************
'QUERIES MUST BE RUN IN THIS ORDER
'**********************************
Me.lboActiveQuery.Caption = "Running 02_qtbl106SupplierProducts"
DoEvents
DoCmd.OpenQuery "02_qtbl106SupplierProducts_Delete"
DoCmd.OpenQuery "03_qtbl106SupplierProducts"
Me.lboActiveQuery.Caption = "Running 05_qtbl106SupplierInfo"
DoEvents
DoCmd.OpenQuery "04_qtbl106SupplierInfo_Delete"
DoCmd.OpenQuery "05_qtbl106SupplierInfo"
Me.lboActiveQuery.Caption = "Running 07_qSupplierProducts_InfoLink"
DoEvents
DoCmd.OpenQuery "06_qSupplierProducts_InfoLink_Delete"
DoCmd.OpenQuery "07_qSupplierProducts_InfoLink"
DoCmd.SetWarnings True
End Sub
In Access 2007, I’m having a little issue displaying a form that runs
queries on load. Below is my code.
When I double click the form, the queries begin to run but the form only
appears after the queries are done.
If I put the code behind a command button it works fine. I can’t use a
command button because I need the queries to run unattended when the DB
opens. Where am I going wrong?
Private Sub Form_Open(Cancel As Integer)
DoCmd.MoveSize 2880, 4320
End Sub
Private Sub Form_Load()
DoCmd.SetWarnings False
'**********************************
'QUERIES MUST BE RUN IN THIS ORDER
'**********************************
Me.lboActiveQuery.Caption = "Running 02_qtbl106SupplierProducts"
DoEvents
DoCmd.OpenQuery "02_qtbl106SupplierProducts_Delete"
DoCmd.OpenQuery "03_qtbl106SupplierProducts"
Me.lboActiveQuery.Caption = "Running 05_qtbl106SupplierInfo"
DoEvents
DoCmd.OpenQuery "04_qtbl106SupplierInfo_Delete"
DoCmd.OpenQuery "05_qtbl106SupplierInfo"
Me.lboActiveQuery.Caption = "Running 07_qSupplierProducts_InfoLink"
DoEvents
DoCmd.OpenQuery "06_qSupplierProducts_InfoLink_Delete"
DoCmd.OpenQuery "07_qSupplierProducts_InfoLink"
DoCmd.SetWarnings True
End Sub