Access Combo Box

S

Sid

I need some help in setting up Access combo box. I would greatly help
someone could help me with the below problem.

I am using three comboboxes in my form. Comb Box 1, Combo Box 2, Combo
Box 3. The row source for each of the combo box is a seperate table.

Table 1 acts as row source for Combo Box 1
Table 2 acts as row source for Combo Box 2

However for combobox 3, I was trying to use 4 different tables as row
source. I am trying to set up a criteria such that row source for comb
box depends on what is selected in combo box 1 & 2

sorry if I made the question overly complicated.

Just as an example......

Combo box 1 - State
Combo Box 2 - City
Combo Box 3 - Zip code

now i am trying to display only zip codes that fit in a particular
city and state combination.

I would greatly appreciate if someone could help me with this. I have
killed my weekend trying to figure out how this could work.

Thanks,
Sid
 
A

Al Campagna

Sid,
Your 3rd combobox (ex. cbo3) should use the values from cbo1 and cbo2 as
criteria to filter the results of cbo3.
In Query design the State and City field of your ZipCode table should
have these criteria...

State City
Zip
Forms!FormName!cbo1 Forms!FormName!cbo2

which would result in one or more zips associated with the State City
values.

Actually, cbo2 could be filtered by cbo1...
State City
Forms!FormName!cbo1

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

Sid,

As Al stated, the query that supports each combo box should be based on the
values in the previous combo box. The piece he forgot to add is that you
need to requery subsequent combos as you go. So the AfterUpdate event of
cboState (recommend you name your combos something that makes more sense than
cbo1, cbo2, ...) would look something like:

Private sub cboState_AfterUpdate

me.cboCity.requery
me.cboZip.requery

End sub

HTH
Dale
 
S

Sid

Sid,

As Al stated, the query that supports each combo box should be based on the
values in the previous combo box. The piece he forgot to add is that you
need to requery subsequent combos as you go. So the AfterUpdate event of
cboState (recommend you name your combos something that makes more sense than
cbo1, cbo2, ...) would look something like:

Private sub cboState_AfterUpdate

me.cboCity.requery
me.cboZip.requery

End sub

HTH
Dale
--
Email address is not valid.
Please reply to newsgroup only.











- Show quoted text -

Guys,

Thanks a lot for helping out. The functionality is working now!

Sid
 
A

Another_Access_Dummy

I have a similar issue, but my comboboxes are based on the same table.

I have a main Category and a subcategory, each are comboboxes.

The table is "Categories" with 2 fields, Main category and sub
category. The key is both fields because Main category can have
duplicate entries...for instance:

Main Category Sub Category
Hardware PC
Hardware Monitor
Hardware CD-ROM


This would be like for a help desk/I.T. support call....

So when the user selects Hardware from the first combo box, I would
like it to populate the second combo box with just the options "PC",
"Monitor", and "CD-ROM".

Can this be done using the approach above? I learned a few things
reading this string, but I'm not sure if it applies since mine is only
one table.

Thank you!
 

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