Question : Database Startup form while other form loads

Hi,

The main form on my db has a subform which takes a few seconds to populate. This has proven a bit confusing to users when it was the db startup form.

I've created a new form which basically just says "loading please wait" and set this as the startup, I am trying to get it to load the second form in it's own Load Event:
Private Sub Form_Load() 'Loads the Forecast Form
    Me.Visible = True
    DoCmd.OpenForm "frmForecasts"
End Sub

This doesn't seem to work - the startup form (definitely set in the db startup settings) never shows and it just shows a blank screen until the main form finally loads.

I've also tried the Open Event, but that didn't help either.

What am I doing wrong?

Answer : Database Startup form while other form loads

Try using DoEvents:

Private Sub Form_Load() 'Loads the Forecast Form
    Me.Visible = True
    DoEvents
    DoCmd.OpenForm "frmForecasts"
    DoEvents
End Sub

DoEvents pass control to the OS, which can sometimes allow Access to "catch up". However, you might find that your form loads behind the first form, or that Access just doesn't "catch up".

Random Solutions  
 
programming4us programming4us