By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

Delay form

P: n/a
Anyway to have a switchboard form open about 10 seconds after the
database comes up? Right now it opens when the database starts up but
now I need the switchboard form to open about 10 seconds after the
Access 2000 database starts up.

I assume I am looking for some sort of delay on the form onload?

I entered this using the design view properties in the form on load
event area:

Private Sub Form_Load()
StartTime = Now()
Do While Now() > StartTime + 10
' Do Something here to eat up a bit of time
StartTime = StartTime + 1
StartTime = StartTime - 1
Loop
End Sub
The above didnt work. There must be a way to make this work? Please
advise.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mark,

Your code will never work ...
Your loop is immediately done. StartTime + 10 is ten days later than Now() . . .
I would try something like this if you want to delay your form:

Dim lngTimer as lomg
LngTimer=Timer()
Do until Timer() > lngTimer +10
Loop
'Code will continue after 10 seconds here
DoWhatYouNeedHere

If you need to use a autoexec-macro you will need to call a function like:

Function autoexec(0
LngTimer=Timer()
Do until Timer() > lngTimer +10
Loop
'Code will continue after 10 seconds here
Docmd.OpenForm "YourSwitchboard"
--
Hope this helps
Arno R


"Mark" <te****@hotmail.com> schreef in bericht
news:49**************************@posting.google.c om...
Anyway to have a switchboard form open about 10 seconds after the
database comes up? Right now it opens when the database starts up but
now I need the switchboard form to open about 10 seconds after the
Access 2000 database starts up.

I assume I am looking for some sort of delay on the form onload?

I entered this using the design view properties in the form on load
event area:

Private Sub Form_Load()
StartTime = Now()
Do While Now() > StartTime + 10
' Do Something here to eat up a bit of time
StartTime = StartTime + 1
StartTime = StartTime - 1
Loop
End Sub
The above didnt work. There must be a way to make this work? Please
advise.

Nov 13 '05 #2

P: n/a
thanks, it now works!
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.