Combo affects several subforms

  • Thread starter auujxa2 via AccessMonster.com
  • Start date
A

auujxa2 via AccessMonster.com

I have a bound form, which selects the record I want by a combo box using:

Private Sub cboSite_AfterUpdate()
Me.RecordsetClone.FindFirst "[Location:] = " & Me.cboSite
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

I have several subforms, all with the "[Location:]" field in it's respective
table as my primary key.

How can I have all the subforms link to the main combo? (me.cboSite)?

Thank you SO MUCH in advance.
 
J

Jeanette Cunningham

Hi auujxa2 ,
yes, you do this using the LinkMasterFields and LinkChildFields.

Select a subform in design view, open the property dialog, on the data, set
the 2 fields I mentioned above to the field Location.
Location would be the primary key in the table for the main form and it
would be a foreign key in the table for the subform.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

Jeanette Cunningham

Type correction

Hi auujxa2 ,
yes, you do this using the LinkMasterFields and LinkChildFields.

Select a subform in design view, open the property dialog, on the data
*tab*, set
the 2 fields I mentioned above to the field Location.
Location would be the primary key in the table for the main form and it
would be a foreign key in the table for the subform.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Jeanette Cunningham said:
Hi auujxa2 ,
yes, you do this using the LinkMasterFields and LinkChildFields.

Select a subform in design view, open the property dialog, on the data,
set the 2 fields I mentioned above to the field Location.
Location would be the primary key in the table for the main form and it
would be a foreign key in the table for the subform.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


auujxa2 via AccessMonster.com said:
I have a bound form, which selects the record I want by a combo box using:

Private Sub cboSite_AfterUpdate()
Me.RecordsetClone.FindFirst "[Location:] = " & Me.cboSite
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

I have several subforms, all with the "[Location:]" field in it's
respective
table as my primary key.

How can I have all the subforms link to the main combo? (me.cboSite)?

Thank you SO MUCH in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top