Running code after a form fully opens

J_Orrell

Registered User.
Local time
Today, 13:08
Joined
May 17, 2004
Messages
55
Sorry guys, second question of the week :o

I've got some code that I want to run automatically when the user opens a form. The code updates a progress bar control on the form, so I need the form to be fully drawn before the code runs. So far I've tried On Current, On Load, and On Open, all of which trigger before the form is drawn.

Using Access 2010

Any ideas?

Thanks again
 
i believe the order of events is:
On Open
On Load,
On Current

on current is the last, and happens after it is drawn.
and also fires when you change records, so the form IS fully rendered.
 
Thanks for the ideas and the link. Unfortunately it doesn't work like that for me. Simple test of:

Code:
Private Sub Form_Current()
MsgBox "Hello"
End Sub

...has the 'Hello' still appearing before the form is drawn. I can see I'm going to have to stick the code in a button-control on the form. It's not the end of the world, but it shouldn't be rocket science to have some code run immediately after a form fully opens :confused:
 
Use the firm's Timer event. Set it to 1 sec after the form is loaded. Timer event is the last event that occurs after the form us fully shown. 1 sec is 1000 timercount.


Private Sub Form_Timer()
Me.TimerInterval=0
' run your code here
End Sub
 
DOH!! Why didn't I think of that! Naturally it worked.

Thank you!
 
You're welcome.
 

Users who are viewing this thread

Back
Top Bottom