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

Auto populate combo box range based upon previous selection

Hello All,

I am a new user to Access. I am currently designing a database
consisting of four tables for multiple users. Rather than bore you
with the goals and such, here is what I am attempting to do:
I have two combo boxes, the first of which contains three text values
(Org 1, Org 2, Org 3) and the second combo box contains a listing of
30 or so clients. I would like to condense the second combo box based
upon the selection of the organization in the first combo box.

For example, if I select "Org 2", I would like it to show the roughly
10 clients that are associated with Org 2 rather than the other 20
clients which do not pertain to that org.

Thanks in advance for the help. Please remember I am a new user to
Access. I realized after reading this forum I will probably be
redesigning soon but would like to solve this issue while it is top of
mind.

Mar 26 '07 #1
3 7849
There are many ways to skin this cat. Set the source for cb2 to
include a filter on Org where Org =cb1.value. Then requery cb2 when
you change the selected value in cb1. That should be one way to
accomplish it.
On Mar 26, 2:49 pm, joseph.mccastl...@gmail.com wrote:
Hello All,

I am a new user to Access. I am currently designing a database
consisting of four tables for multiple users. Rather than bore you
with the goals and such, here is what I am attempting to do:
I have two combo boxes, the first of which contains three text values
(Org 1, Org 2, Org 3) and the second combo box contains a listing of
30 or so clients. I would like to condense the second combo box based
upon the selection of the organization in the first combo box.

For example, if I select "Org 2", I would like it to show the roughly
10 clients that are associated with Org 2 rather than the other 20
clients which do not pertain to that org.

Thanks in advance for the help. Please remember I am a new user to
Access. I realized after reading this forum I will probably be
redesigning soon but would like to solve this issue while it is top of
mind.

Mar 26 '07 #2
On 26 Mar 2007 11:49:35 -0700, jo***************@gmail.com wrote:
Hello All,

I am a new user to Access. I am currently designing a database
consisting of four tables for multiple users. Rather than bore you
with the goals and such, here is what I am attempting to do:
I have two combo boxes, the first of which contains three text values
(Org 1, Org 2, Org 3) and the second combo box contains a listing of
30 or so clients. I would like to condense the second combo box based
upon the selection of the organization in the first combo box.

For example, if I select "Org 2", I would like it to show the roughly
10 clients that are associated with Org 2 rather than the other 20
clients which do not pertain to that org.

Thanks in advance for the help. Please remember I am a new user to
Access. I realized after reading this forum I will probably be
redesigning soon but would like to solve this issue while it is top of
mind.
Leave the Rowsource property of the second Combo Box blank.

Code the AfterUpdate event of the Combo1 to something like this:

Me![Combo2].Rowsource = "Select TableName.[ClientName] From TableName
Where TableName.Organization = '" & Me![Combo1] & "' Order By
[ClientName];"

This assumes the bound column of Combo1 is Text datatype, not Number.

Change the Table and Field names as needed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Mar 26 '07 #3
Same cat, different knife! :)

On Mar 26, 3:19 pm, fredg <fgutk...@example.invalidwrote:
On 26 Mar 2007 11:49:35 -0700, joseph.mccastl...@gmail.com wrote:


Hello All,
I am a new user to Access. I am currently designing a database
consisting of four tables for multiple users. Rather than bore you
with the goals and such, here is what I am attempting to do:
I have two combo boxes, the first of which contains three text values
(Org 1, Org 2, Org 3) and the second combo box contains a listing of
30 or so clients. I would like to condense the second combo box based
upon the selection of the organization in the first combo box.
For example, if I select "Org 2", I would like it to show the roughly
10 clients that are associated with Org 2 rather than the other 20
clients which do not pertain to that org.
Thanks in advance for the help. Please remember I am a new user to
Access. I realized after reading this forum I will probably be
redesigning soon but would like to solve this issue while it is top of
mind.

Leave the Rowsource property of the second Combo Box blank.

Code the AfterUpdate event of the Combo1 to something like this:

Me![Combo2].Rowsource = "Select TableName.[ClientName] From TableName
Where TableName.Organization = '" & Me![Combo1] & "' Order By
[ClientName];"

This assumes the bound column of Combo1 is Text datatype, not Number.

Change the Table and Field names as needed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Mar 26 '07 #4

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

Similar topics

1
by: Alex | last post by:
Acc97. I have a form which within a subform records machine down time. I have a total of 8 machines. (1-2-3 ect.) What I have been doing is using a combo box linked to the record table to...
0
by: BK | last post by:
Hi, I have a problem. I need to auto populate fields based on a value entered in combo box. Initially, I put all the required fields in the combo box, and hide it (set to 0",0",0", ...), then...
11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
1
by: Jim | last post by:
I have a new database in which I have a form where in one field I type a letter A, B, C or D and the field next to it autofills (auto lookups) with a description associated with the specific...
4
by: scolivas | last post by:
I think this is a me thing. but can't remember how to do it. I have a form that I am using and would like for a txt box to automatically populate based on what is selected in a combo box. here...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
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...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
0
by: dudeja.rajat | last post by:
On Sat, Aug 30, 2008 at 2:32 PM, Fredrik Lundh <fredrik@pythonware.comwrote: Fredrik, Thanks so much. That worked. Following this, I can now see that my combo2 has no previous elements and...
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: 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
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: 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,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.