Linked tables and queries in forms

E

efabian

I have two tables, "tblA" and "tblB", that are linked as a 1-to-many
relationship respectively. I have a two comboboxes in a form, "cbo1" and
"cbo2".

"cbo1" has "tblA" as the record source. Based on my record selection in
"cbo1", I want to limit or filter "cbo2" choices to only the records linked
in "tblB" that match.

Can someone help?
 
K

Klatuu

It is called cascading combos. cbo2's row source should be a query that is
filtered based on the contents of cbo1. In the after update event of cbo1,
requery cbo2.

So cbo2.rowsource would look something like:
SELECT SomeField FROM tblB WHERE LinkingField = Me.cbo1
 
E

efabian

Thanks for your help - works great!

Klatuu said:
It is called cascading combos. cbo2's row source should be a query that is
filtered based on the contents of cbo1. In the after update event of cbo1,
requery cbo2.

So cbo2.rowsource would look something like:
SELECT SomeField FROM tblB WHERE LinkingField = Me.cbo1
 

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