473,385 Members | 1,655 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,385 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 3028
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.