I'm fairly new to vba, so this may be a rather elementary question. I am using vba to run queries in another access database, but I want to change the visibility of controls in the current database first. My code is as follows:
-------------------------
If optfrmCompany.Value = 1 Then
optfrmCompany.Visible = False
lblWait.Visible = True
Dim db As Database
Dim qyDel As QueryDef
Dim qyIns As QueryDef
Dim qyUpd As QueryDef
Set db = DBEngine(0).OpenDatabase....
--------------------------
The problem is, Access switches databases before it hides 'optfrmCompany' and displays 'lblWait'. Is there any way to pause while it finishes these commands before defining the new database?
Thanks-
-------------------------
If optfrmCompany.Value = 1 Then
optfrmCompany.Visible = False
lblWait.Visible = True
Dim db As Database
Dim qyDel As QueryDef
Dim qyIns As QueryDef
Dim qyUpd As QueryDef
Set db = DBEngine(0).OpenDatabase....
--------------------------
The problem is, Access switches databases before it hides 'optfrmCompany' and displays 'lblWait'. Is there any way to pause while it finishes these commands before defining the new database?
Thanks-