populating one combo box based on another


T

Tom

I am using access 2003. I have a table called state that lists states. I have
a table called cities that has cityid, state( a lookup in the state table),
and city . THis table contains states and then cities within each state.

I have a table customer that lists ,
customerid,firstname,lastname,address,city,state,and zip.

I create a form based on the customer table but omit the city and state
fields. In the form which I call customer, I go to design view. I create a
combo box for state that merely pulls states from the state table. I name it
combostate. I store the value in the state field. I name the query querycity.

ON the customer form I create another combo box based on the querycity and
only pull the city field in . I store the value in the city field. I name it
combocity

I go to the combostate and go to proprrties and go to after update. In the
after update I make event procedure that says combocity.requery
I create a query based on the city table and only use the city and state
fields. IN the criteria for the state field, I use
{forms]![customer][combostate]

This technique works great. when I choose a state only the cities in that
state populate the city box.

Now the prblem. When I repeat the process trying to get a zip combo box that
is dependent upon the cities chosen in the comboity. It doesn't work it says
it is too complex. Any suggestions or workarounds would be much apreciated.

Thanks
 
Ad

Advertisements

T

tina

post the SQL statement that you use for the zip code combobox control's
RowSource (or, if you're using a query for the RowSource, post the SQL
statement of the query).

hth
 
Ad

Advertisements

J

Jeff Boyce

Tom

A possible wrinkle to consider ...

It may no longer be true, but at one point we had a community (two) near
where I live that had one zip/postal code covering two cities. Wouldn't
that 'mess' with your design?

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

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