473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Access Combo Box

Sid
I need some help in setting up Access combo box.

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

Jun 25 '07 #1
2 3103
Sid <ad******@gmail.comwrote in
news:11**********************@k79g2000hse.googlegr oups.com:
I need some help in setting up Access combo box.

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
What you give as an example is very different from your question
because all zip codes are (should be) in one table. Having one
table with a filter is very different from having four (4)
separate tables.

Anyways FWIW, code for your example would be as follows:

cboState's row source is of course
SELECT Distinct State from tblCipCodes;

In the afterUpdate event for State, you execute the statement
me.cboCity.requery.

cboCity's rowsource is
SELECT Distinct City from tblZipCodes
Where State = forms!cboState.value ;

in the afterUpdate event for cboCity put
me.cboZipCodes.requery.

cboZipCodes row source would be
SELECT ZipCode FROM tblZipCodes
WHERE State = forms!myForm!cboState
AND City = forms!myForm!cboCity

But you need to select a different .rowsource property based on
the selection of the first two combos. which is much more
involved. Usually it is also a sign of poor normalization.

More information please: what are the four tables and how do
they relate to the first two combo boxes?

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 25 '07 #2
Sid
On Jun 25, 8:33 am, Bob Quintal <rquin...@sPAmpatico.cawrote:
Sid <addal...@gmail.comwrote innews:11**********************@k79g2000hse.google groups.com:


I need some help in setting up Access combo box.
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

What you give as an example is very different from your question
because all zip codes are (should be) in one table. Having one
table with a filter is very different from having four (4)
separate tables.

Anyways FWIW, code for your example would be as follows:

cboState's row source is of course
SELECT Distinct State from tblCipCodes;

In the afterUpdate event for State, you execute the statement
me.cboCity.requery.

cboCity's rowsource is
SELECT Distinct City from tblZipCodes
Where State = forms!cboState.value ;

in the afterUpdate event for cboCity put
me.cboZipCodes.requery.

cboZipCodes row source would be
SELECT ZipCode FROM tblZipCodes
WHERE State = forms!myForm!cboState
AND City = forms!myForm!cboCity

But you need to select a different .rowsource property based on
the selection of the first two combos. which is much more
involved. Usually it is also a sign of poor normalization.

More information please: what are the four tables and how do
they relate to the first two combo boxes?

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account fromhttp://www.teranews.com- Hide quoted text -

- Show quoted text -
Bob,
Thank you very much for the cue. the functionality is now working.

Sid

Jun 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: will eichert | last post by:
Greetings. I have a problem with a combo box incorrectly displaying blank items when returning to a form from a modal form. It's fine when the main form first comes up, but gets messed up when the...
5
by: Scott | last post by:
I have a customer that had developed an Access97 application to track their business information. The application grew significantly and they used the Upsizing Wizard to move the tables to SQL...
24
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
0
by: Mike | last post by:
I have a form in a Access Project (SQL DB on the back end). On this form I have created a Combo box that pulls a list of dept and dept #'s from the DEPT table, and displays the dept name in the...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
6
by: onnodb | last post by:
Hi all, While working on an Access UI to a MySQL database (which should be a reasonable, low-cost, flexible interface to the DB, better than web-based, much less costly than a full-fledged .NET...
0
by: uthooker | last post by:
I have an Access form with some combo boxes in the Form Header that are enabled/disabled using conditional formatting based on the setting in a checkbox also in the Header (Combo box = Enabled by...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.