Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box listing field names as query input 2

Status
Not open for further replies.

deadyankee

Technical User
Jul 22, 2001
11
GB
Hi all,

Hopefully this problem is different to the previous combo box probs ! I have a form with two combo boxes. The first lists field names and I would like the second to list all the categories present within the chosen field. So, for example, the user could choose the field 'Gender' in the first combo box and be given the choices of 'Male' of 'Female' in the second. Any suggestions on how to do this?

I'm a bit of a newbie, so please be gentle with me ;)
 
"Select Distinct TableName." & chr(34) & Me.cboField & Chr(34) & "from TableName;" MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
When making your tables, you can use the lookup wizard as a field for Gender. When creating the field, go to Data type, select Lookup Wizard and away you go. When you create forms or whatever, based on the table, it will automatically make a combo box fro you whcih has "M" and "F" (or whatever you specified) as the two user choices.
However, I think the first response is also appropriate to your needs. The SQL string MichaelRed wrote about would be placed as the row source rpoperty of the control (ie. combo box).
The row source can also be based on a query that you design yourself.
hope I've understood some of your problema dn been of help.
Access is such fun!
 
Guys,

Thanks very much for the help. Hopefully my client wioll be impressed by the results
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top