473,624 Members | 2,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7866
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.Organ ization = '" & 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...@examp le.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.Organ ization = '" & 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
2210
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 select, the reasons based upon generic terms. The problem is that I have so many records now, that it takes more time looking and picking out the correct fault reason than it does completing the rest of the form!
0
2024
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 use code: Name=cbBox.column(3) to get the value. It works fine, but I have problem with performance. The source of the combo box is a table from another database that keeps adding up (currently we have around 1500 records, around 5-20 new records...
11
4042
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 again, Excel hangs. OR if I open Excel again (say from a desktop icon) before I close Access, Excel hangs. (this has happened for both 97 & 2000 for me) I of course thought that I mustn't be unloading a variable properly.
1
2351
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 letter. If I edit the description for one record, it edits the same for all records in which I've applied the same autofill (auto lookup). I'm set up where the letters come from a lookup combo box (limit to list "Yes") and the record source for the...
4
3522
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 is what I have for form fields: Carton # <auto number> Item Title <txt> Item Accquisition Date <txt (date)> Is item consigned <yes/no>
4
13952
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 tbl_Input has three fields: OSE_Job, OSE_Name, OSE_Wt I have populated tbl_OSE_Info table. I need to create a form that will store the data in tbl_Input I have racked my brain so much trying to figure out how to auto populate a field based on a...
5
3994
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 Fields Names: countrycode, make
2
3320
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
1597
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 contains only the elements relevant to selection in combo1. Now, as soon as I select something in combo 2 and go back to change selection in combo1 the combo2 must get its history cleared up (i.e the previous selection in combo2's entry subwidget)
0
8249
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.