Loading order of main form and subform

  • Thread starter Thread starter robert d via AccessMonster.com
  • Start date Start date
R

robert d via AccessMonster.com

I'm just starting to use subforms. I have an unbound main form with several
unbound subforms. When navigating from a different form to this form, the
main form is supposed to load with data as is the subform. I've tried
setting the SourceObject to spaces when the main form loads, but it looks
like the subform code actually loads first (observed when stepping through
the code).

The subform needs to get data from the main form in order to load correctly.
Is there any way to get the main form to load first and then have the subform
load.

Thanks.
 
Set the SourceObject and/or the Recordsource in code after you set the Main
form's Recordsource in code. What I don't quite understand is you say that
the Main form is unbound, yet the subform(s) need to get data from it. To do
that you'd need to set the Main form's Recordsource in code in the form's
OnOpen event. If that's the case, just add the code to the end of your
existing code.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top