473,395 Members | 1,516 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,395 software developers and data experts.

How to change the contents of a combo box based on another

Hi,

I wonder if any one can help, I'm pretty new to Access and I can't
figure out how to change the contents of a combo box based on a
selection I make in another.

Let me explain I have a combo box where I can select a continent from
a continent table. I would like the contents of a second combo box to
reflect my choice of continent and list countries that are in that
continent. These countries are in separate tables/queries (actually a
query based on the table that orders the countries alphabetically).

The database contains the following tables/queries

Continent Table: SOURCE OF FIRST COMBO BOX
Continent ID
Continent

European (American, Asian) Countries Tables:
Europen Country ID
Europen Country

European Country List (Query) SOURCE OF SECOND COMBO BOX
Eurpean Country (ordered sourced from above table)

I haven't quite grasped how Access passes on information from one area
to another so could anyone describe as simply as possable how to go
about it would be greatly appreciated.

Regards,

Jeff
Nov 12 '05 #1
2 3031
Jeff Barry wrote:
Hi,

I wonder if any one can help, I'm pretty new to Access and I can't
figure out how to change the contents of a combo box based on a
selection I make in another.


<snipped>
http://www.mvps.org/access/forms/frm0028.htm

This site should be your first port of call when you need to work something
out.
Nov 12 '05 #2
jb****@picr.man.ac.uk (Jeff Barry) wrote in
news:b8**************************@posting.google.c om:
Hi,

I wonder if any one can help, I'm pretty new to Access and I
can't figure out how to change the contents of a combo box
based on a selection I make in another.

Let me explain I have a combo box where I can select a
continent from a continent table. I would like the contents of
a second combo box to reflect my choice of continent and list
countries that are in that continent. These countries are in
separate tables/queries (actually a query based on the table
that orders the countries alphabetically).

The database contains the following tables/queries

Continent Table: SOURCE OF FIRST COMBO BOX
Continent ID
Continent

European (American, Asian) Countries Tables:
Europen Country ID
Europen Country

European Country List (Query) SOURCE OF SECOND COMBO BOX
Eurpean Country (ordered sourced from above table)

I haven't quite grasped how Access passes on information from
one area to another so could anyone describe as simply as
possable how to go about it would be greatly appreciated.

Regards,

Jeff

First of all you will find it easier, (much easier), if you put
all your countries into a single table With three fields,
Continent ID, CountryID, Country.

Create a continents combo, cboContinents.

Create a combo for the countries, cboCountries.

Then you set the rowsource for the cboCountries to
="SELECT country from countries where continentID = " &
cboContinents"

put me.cboCountries.requery in either the
cboContinents_AfterUpdate event or the cbocountries_OnEnter
event.

Use the form.

Bob Q
Nov 12 '05 #3

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

Similar topics

5
by: Stewart Midwinter | last post by:
I've got an app that creates an object in its main class (it also creates a GUI). My problem is that I need to pass this object, a list, to a dialog that is implemented as a second class. I want...
12
by: techie | last post by:
Hi All, I have a portal working on an intranet for a company. The portal was designed keeping in mind the resolution of 1024*768. I am including a ..css file in all the files. Now i have to make...
5
by: Glenn Mulno | last post by:
Hi, I am trying to create a report page for several teams. Each team runs the same reports but the reports use different values. For a while this was getting insane everytime I updated the...
2
by: nsteele84 | last post by:
Hi I need to clear the contents of a pulldown and then load new contents into it. Is this possible in Javascript? If so how? Thanks Nick Steele
3
by: Antoine Janssen | last post by:
hi, I would like to create two combo boxes. In the first one you can select a user in the second one you can select a project. To simplify the selection i would like to shorten the project list...
2
by: Lorenzo Thurman | last post by:
I would like to have an element, a text string, change into a select when a mouseover occurs and then change back to text when a selection is made or when a mouse out occurs. I looked a t using...
11
by: free4trample | last post by:
First of all let me say that I know very little about javascript. what i need to do is to write a javascript functin which will change the background color of the table rows based on entrees in...
4
by: seangibson | last post by:
Is there a way to change the appearance of my form based on which option button is selected? I am using a form to input data into a table of transactions. There are basically 3 types of...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
1
by: Binod Bihari | last post by:
I have two combo box.Like combo1 and combo2.In combo1 i have list of countries.On select of specific country i would like get the respective district options in combo2. using java script Thanks &...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.