florida
10-28-2004, 05:29 AM
Anyway to have a switchboard form open a couple seconds after the database comes up? Right now it opens when the database starts up but now I need the switchboard form to open a couple seconds after the Access 2000 database starts up.
loquin
10-28-2004, 08:55 AM
It's been a while since I used VBscript in Access, but can't you add a sleep call in the form startup event? Or, even a Do/While loop until timer > Starttime + 2 ?
The second question is why you would need to do this? We might be able to suggest an alternate approach if we have more info.
florida
10-28-2004, 09:58 AM
advise if this is how I would do it in my form load function?
Private Sub Form_Load()
While loop
until timer > Starttime + 2
end while
End Sub
I need to do this because I am accessing this in a web page and it will work if I delay the Switchboard.
Thanks
loquin
10-28-2004, 11:07 AM
' Something like this
Private Sub Form_Load()
Starttime = Now() ' Or some similar statement to get the current time
Do While Now() > StartTme + 2
' Do Something here to eat up a bit of time
Starttime = StartTime + 1
StartTime = StartTime - 1
Loop
End Sub
You would need to get the current time BEFORE starting your loop. Then, compare the current time to the start time...
florida
10-28-2004, 11:51 AM
Thanks but it still doesnt delay opening the Swichboard form.
I put what you suggested in the design view part where I clicked on the upper left corner of the form and in properties I found the on load event part.
I entered just as you gave me:
Option Compare Database
Private Sub Form_Load()
StartTime = Now() ' Or some similar statement to get the current time
Do While Now() > StartTime + 10
' Do Something here to eat up a bit of time
StartTime = StartTime + 1
StartTime = StartTime - 1
Loop
End Sub
Please advise.