link child fields - list box

G

Guest

Hi all,
In my main form I have a listbox listing fieldA (primary key) from
table1, and I have a subform displaying data queries from table2 (one of the
field is related to fieldA in table1. Can someone please tell me how can I
link the selected (clicked) listbox item and query the subform using link
child fields?


Thanks,
Jeff
 
J

John Vinson

Hi all,
In my main form I have a listbox listing fieldA (primary key) from
table1, and I have a subform displaying data queries from table2 (one of the
field is related to fieldA in table1. Can someone please tell me how can I
link the selected (clicked) listbox item and query the subform using link
child fields?

Set the Master Link Field to the name of the listbox (which must be a
single select, not multiselect, and have the FieldA as its bound
column); be sure to enclose the name in [square brackets].

Set the Child Link Field to the name of the corresponding foreign key
field in the subform's recordsource query.

John W. Vinson[MVP]
 
G

Guest

thanks guys, your posts help me alot :)



John Vinson said:
Hi all,
In my main form I have a listbox listing fieldA (primary key) from
table1, and I have a subform displaying data queries from table2 (one of the
field is related to fieldA in table1. Can someone please tell me how can I
link the selected (clicked) listbox item and query the subform using link
child fields?

Set the Master Link Field to the name of the listbox (which must be a
single select, not multiselect, and have the FieldA as its bound
column); be sure to enclose the name in [square brackets].

Set the Child Link Field to the name of the corresponding foreign key
field in the subform's recordsource query.

John W. Vinson[MVP]
 
G

Guest

Thank you all so much. That really cleared up an issue I was spending a lot
of time on. Also didn't take the 50 paragraphs of code I thought it would.

WebDude said:
thanks guys, your posts help me alot :)



John Vinson said:
Hi all,
In my main form I have a listbox listing fieldA (primary key) from
table1, and I have a subform displaying data queries from table2 (one of the
field is related to fieldA in table1. Can someone please tell me how can I
link the selected (clicked) listbox item and query the subform using link
child fields?

Set the Master Link Field to the name of the listbox (which must be a
single select, not multiselect, and have the FieldA as its bound
column); be sure to enclose the name in [square brackets].

Set the Child Link Field to the name of the corresponding foreign key
field in the subform's recordsource query.

John W. Vinson[MVP]
 

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