Combo boxes to show sub categories

G

Guest

Hi

I have a problem figuring out how to design my combo boxes.

I have a number of clients, and within each client, a number of divisions.

I have a tblclient with the field [client]
and a tbldivision with 2 fields [client] and [division] so their
relationship is ONE tblclitnt TO MANY tbldivision

In my combo boxes in forms, what code do I need to get the division combo
box to only show divisions of the selected client (already selected on the
form in a previous combo box)?

I hope this makes sense

Many thanks for your help & Happy Friday!
 
G

Guest

Hi Jenny

About your ONE tblclitnt TO MANY tbldivision (Parent/Child)

Use this as the recordsource for your 2nd comb (change the names to whatever
you use). I have assumed you want the combo sorted by client name but your
can change this

SELECT tblclient.client FROM tblclient WHERE tblclient.client =
[1stComboBoxName] ORDER By tblclient.client

Add any other fields you want here XXXX
SELECT tblclient.client XXXX FROM tblclient WHERE tblclient.client =
[1stComboBoxName] ORDER By tblclient.client


Oh yeah and don’t forget to requery your 2nd combo afterupdate
Something like this
Me!FormName.Form.2ndComboName.Requery
 

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