Linking subforms -

G

good12find

I have two subforms placed in a main unbound form.

Subform1 - list of vendors
Subform2 - vendor detail

I'd like to select a record (or vendor) on Subform1 and have Subform2
automatically filter to the selected record.

The purpose for this is to use a subform list instead of a combo box.

Possible?
 
M

Michael Gramelspacher

I have two subforms placed in a main unbound form.

Subform1 - list of vendors
Subform2 - vendor detail

I'd like to select a record (or vendor) on Subform1 and have Subform2
automatically filter to the selected record.

The purpose for this is to use a subform list instead of a combo box.

Possible?

I would put a hidden text box in the main form heading.Llet's name it
txt_vendor_id. This text box gets it value from subform1. Its
countrol Source would be something like =[subform1].Form.vendor_id
Then use subform2's Link Child Fields/Link Master Fields to link
subform2 to the text box on the main form.
 
G

good12find

Very helpful and it worked - thank you.

Next question.

Can I have both a combo box (for looking up individual vendors, typing in by
name) and list as mentioned, filtering the subform2?

Thanks!

Michael Gramelspacher said:
I have two subforms placed in a main unbound form.

Subform1 - list of vendors
Subform2 - vendor detail

I'd like to select a record (or vendor) on Subform1 and have Subform2
automatically filter to the selected record.

The purpose for this is to use a subform list instead of a combo box.

Possible?

I would put a hidden text box in the main form heading.Llet's name it
txt_vendor_id. This text box gets it value from subform1. Its
countrol Source would be something like =[subform1].Form.vendor_id
Then use subform2's Link Child Fields/Link Master Fields to link
subform2 to the text box on the main form.
 
M

Michael Gramelspacher

Very helpful and it worked - thank you.

Next question.

Can I have both a combo box (for looking up individual vendors, typing in by
name) and list as mentioned, filtering the subform2?

Thanks!

You can have subform1 linked to a combo box in the main form heading
by way of Link Child Fields/Link Master Fields.

You can also use the AfterUpdate event of the combo box to change the
recordsource of subform1 if you prefer.
 
H

HELENA SMITH

Michael Gramelspacher said:
You can have subform1 linked to a combo box in the main form heading
by way of Link Child Fields/Link Master Fields.

You can also use the AfterUpdate event of the combo box to change the
recordsource of subform1 if you prefer.
 

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

Top