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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Combo_Box display values

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
US
I need help with displaying a specific list of values in a combo box. For example, say I want the user to choose a state from one combo box and then the next combo box would then display specific zip codes associated with the state that the user chose.
If someone can tell me how to do this with a query or something that would be helpful. I know how to create a combo box already but I'm not so good with making queries.
Thanks,
Laina
 
create a query for combo1. The using the wizard add a combo box specifying the query as the datasource. Then create a query for combo2. In the criteria for the 2nd query (in the zip code field) place:
forms![form name]!combo1
So the query will in effect say show me only the states where the zip code = the zip code chosen in combo1.
Add 2nd combo box choosing query 2 as the datasource.

Nick
 
Then in the after update of combo1, put something like combo.requery.

Nick
 
Why would I reference a form when the database doesn't have any forms?
Can't I use an SQL statement in the row source field?
 
If you have a combo box, it means you must have a form as the container....
 
Not necessarily TTThio, you can make a combo box at the table level with no forms in the system. However Laina won't be able to make dependent boxes because there are no events that will allow the table to react to the person selecting the state. So a form with code to requery the record source of the combo box will be needed to do what she asked.

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top