Linking two datasheet subforms


G

Guest

I have an unbound form with two subforms in datasheet view.

subform1 lists assembly part numbers (RecordSource= tbl Tracking).
subform2 lists sub assembly part numbers based on assembly PN (RecordSource=
tbl SubAssy).

I want to restrict the results in subform2 to the selected record in
subform1. That is... click on one record in subform1 and get filtered results
on subform2.

I'm new to access, so any help is appreciated.
 
Ad

Advertisements

T

tina

presumably the two tables are linked, with a primary key in tblParts, which
i'll call PartID, used as a foreign key in tblSubParts, which i'll call
PartIDfk. the first subform is bound to tblParts, and the second subform is
bound to tblSubParts.

in the main form's Design view, add an unbound textbox control called txtID.
set its' ControlSource property to

=[Subform1ControlName].[Form]![PartID]

make sure that you use the name of the subform control, *not* the name of
the subform object as it shows in the database window - sometimes the two
names are different.

in the main form's Design view, click once on the second subform to select
it. in the Properties box, set the LinkChildFields property to

[PartIDfk]

set the LinkMasterFields property to

[txtID]

hth
 

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

2 Subforms 1
requerying a subform 1
Form with two subforms 1
Using multiple subforms 8
linking subform to subform? 3
Link Subform to Subform 10
subform has subform total 2
Subform Requery 5

Top