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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sync multiple forms, different recordsets, not parent/child?

Status
Not open for further replies.

NXMold

Technical User
Jul 22, 2008
104
I am building a complex interface, the main form is blank with two sub-forms. The recordset of each subform is linked via code on the main form.

Code:
Set Me.SubFrm2.Form.Recordset = Me.SubFrm1.Form.Recordset

In this way, when you select a record from SubFrm1 (list view) you can edit it in SubFrm2 (detailed view). I like this approach better than having so many popup forms, you don't get lost/disoriented in the application as easily.

Now for the problem:
I want to add a third sub form. This one has a different recordset, but I want it synced with the other two (the third form should display data realted to the selected record, and change as you scroll through records).

I know this relationship is possible with parent/child linked fields, but because of the way I constructed three sub-forms on a blank container form this relationship is not possible.
 
Access does not make this clear and the Wizards tend to suggest that you need a parent child relationship. Actually the subform control is more powerful than that.

For example I can simply link a subform to an unbound text box or other control. If I type in the number 1 into that box I can show all records with a value of 1 in one of the fields. Normally that is a foreign key. Then any new records will get the value 1 in the linked field.

Subforms do not require a parent child relationship to link.
 
Thats fantastic!!!! Thank you.

On before update of the 'list' sub form it sets the value of an unbound text box on the main form, the other sub forms are linked to that text box. Pretty snappy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top