Form, Subform, SubSubForm - Order of Form Events?

Cosmos75

Registered User.
Local time
Today, 11:50
Joined
Apr 22, 2002
Messages
1,281
Not sure if this belongs here or in the VBA forum section but here goes.

I have a Main-Form that has a Sub-Form and a Sub-Sub-Form.

How do the Open and Current events fire for all three forms? As far as I can tell, it is in this order;
1) Sub-Sub-Form – OPEN
2) Main-Form – OPEN
3) Main-Form - CURRENT

In general, I know that these two events fire in this order;
Open → Current

But what happens for subforms?

Order of events for database objects
In the help article above it says
When you open a form containing a subform, the subform and its records are loaded before the main form. Thus, the events for the subform and its controls (such as Open, Current, Enter, and GotFocus) occur before the events for the form. The Activate event doesn't occur for subforms, however, so opening a main form triggers an Activate event only for the main form.
But it seems only the last subform level fires, but not ones in between?
:confused:
 
The Current events for the subforms only fire when you're in them, and not on the main form
 
Rich,

Thank you!

That makes perfect sense now that I think about it and after you told me so!
:p

Well, I used the Debug.Print to get the order of firing of the OPEN, LOAD and CURRENT events. Here it is in case anyone else is also wondering.
  1. SubSubForm- Open
  2. SubSubForm - Load
  3. SubForm - Load
  4. Main - Open
  5. Main - Load
  6. Main - Current
 

Users who are viewing this thread

Back
Top Bottom