Startup Form

G

Guest

I have a split database. When the user opens the front end db, I want them
to see my startup form that says Loading data (while the tables get linked
and it checks user information - might take a few seconds). Then the main
menu form opens (on open of main form, it closes the startup form).

I have the code on the "On Open" event of my startup form, but I never see
the startup form.

Any suggestions?
 
A

Allen Browne

Force a Repaint of the splash form.

What I do is nominate a startup form that the user will never see. It
displays the splash form, runs the initializaton code, opens the
switchboard, and then cancels itself. (That's a dead simple way to free up
the memory used by the init. code.)

So, Form_Open includes stuff like this:
Dim dbNow As Date
Const conSplashForm = "frmHelpAbout"
Const conNextForm = "frmSwitchboard"
Const conSeconds As Long = 2&

DoCmd.OpenForm conSplashForm
With Forms(conSplashForm)
.ReCalc 'If the form has calculated controls.
.Repaint 'This forces it to display.
End With
dtNow = Now()
'other useful stuff.

Do While DateDiff("s", dtNow, Now()) < conSeconds
If IsLoaded(conSplashForm) Then
DoEvents 'There's no re-entry problems on this event.
Else
Exit Do
End If
Loop
If IsLoaded(conSplashForm) Then
DoCmd.Close acForm, conSplashForm
End If
DoCmd.OpenForm conNextForm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top