Startup form opening another form in Open event

nschroeder

nschroeder
Local time
Today, 16:34
Joined
Jan 8, 2007
Messages
186
For certain user types, I want my startup form to open another form. I'm doing this from the Open event, and it works fine, but the startup form still ends up on top of the 2nd form. I suppose this is because the startup form events don't finish until after the 2nd form is open, which brings the focus back to the startup form. I've tried moving the code to other events, and hiding the startup form from events in the 2nd form, but so far no luck. Any suggestions?
 
You can start a timer on the second form, and then run a SetFocus, something like...
Code:
Private Sub Form_Load()
   Me.TimerInterval = 100
End Sub

Private Sub Form_Timer()
   Me.TimerInterval = 0
   Me.SetFocus
End Sub
So the timer starts when the second form opens, code on the first form completes, the timer event on the second form fires, turns itself off, and sets itself as focussed.
 
Last edited:
I would have never thought of that, but it works perfectly. Thanks!
 

Users who are viewing this thread

Back
Top Bottom