Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link contents of SubFormB to contents of SubFormA

Status
Not open for further replies.
Jun 10, 2011
17
US
I have a main form with 2 sub-forms
Contents of SubFormA are based on the MainForm
Even though SubFormB is also on the MainForm I need it's contents to link to SubFormA not the MainForm
i.e.
MainForm
SubFormA links up to MainForm
SubFormB links up to SubFormA
 
I generally add an invisible text box on the main form named txtMasterField. Then I add code to the On Current event of the SubFormA like:
Code:
On error resume next
Me.Parent.txtMasterField = Me.LinkFieldName
Then just set the Link Master Child of the SubFormB to txtMasterField and ChildFieldName.

If you can't figure this out, you should come back with some field names.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top