combo box help


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

M

MikeJohnB

Tom

Now that Arvin has answered your question can I add

Please don't multi post your questions in several locations, people who are
trying to assist and answer your question only to find it has been answered
in different threads in other groups, most frustrating.

Regards
 
Ad

Advertisements

T

Tom

Thank you I will look at the sample you gave me
Tom

Arvin Meyer said:
Have a look at the sample file that uses list boxes (same code):

http://www.accessmvp.com/Arvin/Combo.zip
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Tom said:
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
 

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