florida
October 28th, 2004, 07:25 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 want the switchboard form to open a couple seconds after the Access 2000 database starts up.
shamus
October 29th, 2004, 07:43 AM
You could try this. Create a new form that does not have a record source(or any objects). You could name it StartDelay. Open your new form in design view and open the Form properties. Under the Event tab, you need to define two items. The first is the On Open. Using the code build,create the following:
Function startdelay()
On Error GoTo startdelay_Err
DoCmd.Minimize
startdelay_Exit:
Exit Function
startdelay_Err:
MsgBox Error$
Resume startdelay_Exit
End Function
This will minimize your form making it hidden while it preforms its next function.
Next you want to define the On Timer event, Use code builder to create the following:
Function openswch()
On Error GoTo openswch_Err
DoCmd.OpenForm "Switchboard", acNormal, "", "", , acNormal
DoCmd.Close acForm, "StartDelay"
openswch_Exit:
Exit Function
openswch_Err:
MsgBox Error$
Resume openswch_Exit
End Function
Now, you have to define Timer Interval under events. The format is milliseconds,as in 10000 is equal to 10 seconds. Set as you like. NOW FINALLY! Under TOOLS STARTUP, assign your form StartDelay under Display Form/Page and you will have your delay.
Another option is to Design the StartDelay form to "look" like a splash screen with logos,pics, and other things on it (delete the On Open command so it does not minimize)
Hope this helps