Here're a few thoughts...
- When a form has a subform, the subform loads first and its current event runs. Then the main form loads, runs its current event, and then applies any constraints/filters (LinkMaster and LinkChildFields) and if that causes the subform record to change, which is likely, then the current event on the subform runs again.
- You can test this behaviour by putting a couple of MsgBoxes in the Form and Subform Form_Open() event handlers and check out the order in which they fire.
- One option you have, and you start to notice the performance improvement if your subform's table gets big, is programmatically load the subform object AFTER the main form loads. To do this, leave the SourceObject property of the subform control blank at design time, and at runtime, say in the MainForm's Open event handler, set the value of the SourceObject property to the name of the form you want to load into the subform control.
- This is also a nice way to vastly speed up and simplify forms that have multiple subforms on a tab control. You can make the tab transparent and have just one subform control. Then programmatically change the SourceObject property of the subform control whenever the tab changes.
Hope that helps,
Mark