Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
On Load Form and SubForm
Bruce McCormick 
   
2 years ago
Given a procedure triggered in an on load event, what difference, if any, occurs when the event trigger is in the parent vs the child's On Load event?

If there is, i just rather not learn by making a mistake and not knowing what the heck happened!

Thank you!
Sami Shamma  @Reply  
             
2 years ago
Hi Bruce,

The answer depends on how you structured the forms. For example, do you have more than one subform? Using a message box, you can test to see the timing of those events and which works best for you. Needless to say, in general, the master form will trigger before the subform.
Bruce McCormick OP  @Reply  
   
2 years ago
Thank you Sami! I really like the idea of experimenting with a msgbox to learn, i'll give it a shot!
Thomas Gonder  @Reply  
      
2 years ago
@ Bruce As Sami says, depending on your form design, what triggers and when can vary. For me, the sub form seems to fire first. This can be a real pain, and is for me, a significant design flaw in Access (as a sub form often needs data from the main form). Just to note, the Form_Current may fire off more than once for the main and sub forms. This can play havoc in your code depending on how complicated it is.

After discovering this, it's the primary reason that, in the ADS, I added logic to display all the triggered procedures and display them in the "status box" for developers. I hate message boxes except in a few limited circumstances.



Thomas Gonder  @Reply  
      
2 years ago

Thomas Gonder  @Reply  
      
2 years ago
The above image was just to open a form and bring up the first record. Can you imagine 31 message boxes? And the order in which they appeared? You can see the Activate and Focus procedures are quite active and often redundant. I have code to eliminate the redundant calls to Form_Current, so you don't see those here. Setting breakpoints is an alternative.
Bruce McCormick OP  @Reply  
   
2 years ago
Uhg!

I'm going to have a longer look, but best i go upstairs right now to await the little trick-or-treaters...

Thank you for your input - the rabbit hole grows deeper-
Bruce McCormick OP  @Reply  
   
2 years ago
Y'all were right, this is rather weird. I set msgboxes in empty On Load, On Current and On Active events in a parent and child.

On Active never fired in the straight opening of the parent form, but... The sequence was:
Child On Load
Child On Current
Parent On Load
Parent On Current

Really think this doesn't make a heck of a lot of sense, would think the Parent would be completely resolved except for the child and only then the child would be processed. I'm sure there is a good reason that i may just too dumb to understand, like maybe the programmer who did this did it on a Friday.
Thomas Gonder  @Reply  
      
2 years ago
@ Bruce, in my research, it's been child and parent for decades. I've yet to see a logical reason for it.
Like I said earlier, instead of msgboxes, you can use breakpoints. Put them on the first line of every procedure and have fun watching what crazy stuff happens.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 1:46:00 PM. PLT: 1s