f



Fill combo/list box based on previous combo box selection?

I am fairly new to database design and am having some difficulty
getting my combo boxes to work as I'd like them to.  I would like to
create a form with two combo boxes; the first one would select
�JobNum' from my master job table and the second would select a �Supt'
associated with the selected JobNum.

My tables are setup like this:
	-tblEmp:	Emp# (PRIMARY KEY), EmpName, etc.
        -tblSupt:  	SuptEmp#, Job#
	-tblInjury:	InjuredEmp#, Job#, Supt#, etc.
	-tblJob:        Job# (PRIMARY KEY), JobName, etc.

How can I setup my two combo boxes so that:

Combo Box 1 selects Job# from the list of Job#'s?  I can get this far,
but a can't seem to tackle the AfterUpdate event in order to
successfully populate the 2nd combo box.

And Combo Box 2 selects an associated Supt#, a list populated from the
selection in Combo Box 1?

Thanks in advance for any assistance.

Nick
0
nfemal
8/19/2004 9:21:57 PM
comp.database.ms-access 1111 articles. 0 followers. Post Follow

1 Replies
653 Views

Similar Articles

[PageSpeed] 0

Nick,

If I understand you right, you want to select a Job# and have the
second combo box update to show Supt#'s for the selected Job#. This is
what I would do.

This is done using a form. Since you have the Job# combo box working
let's look at the Supt# combo. Create the Supt# combo like normal.
Then go to the properties of the Supt# combo and go to the data tab.
Then goto row source and click the build button. From here you can add
the Job# field from your tblSupt to the design grid and set the
criteria to the Job# combo box on your form. This will tell the combo
box what to display. But to make it work like you want you have to go
to the after update property of the Job# combo box and click Code
builder. Here you will type in Me.Combo2.requery. (Combo2 is the name
of the Supt# combo box) This will requery your box every time you
change something in the Job# combo box.

If your confused let me know and I can e-mail you an example.

Good luck,
Wes

nfemal@findorff.com (nick) wrote in message news:<d7b63544.0408191321.761dccd8@posting.google.com>...
> I am fairly new to database design and am having some difficulty
> getting my combo boxes to work as I'd like them to.  I would like to
> create a form with two combo boxes; the first one would select
> ?JobNum' from my master job table and the second would select a ?Supt'
> associated with the selected JobNum.
> 
> My tables are setup like this:
> 	-tblEmp:	Emp# (PRIMARY KEY), EmpName, etc.
>         -tblSupt:  	SuptEmp#, Job#
> 	-tblInjury:	InjuredEmp#, Job#, Supt#, etc.
> 	-tblJob:        Job# (PRIMARY KEY), JobName, etc.
> 
> How can I setup my two combo boxes so that:
> 
> Combo Box 1 selects Job# from the list of Job#'s?  I can get this far,
> but a can't seem to tackle the AfterUpdate event in order to
> successfully populate the 2nd combo box.
> 
> And Combo Box 2 selects an associated Supt#, a list populated from the
> selection in Combo Box 1?
> 
> Thanks in advance for any assistance.
> 
> Nick
0
sloanw
8/20/2004 1:35:30 PM
Reply:

Similar Artilces:

Changing combo box list based on another combo box selection
I have a continuous form that has one combo box (cbo1) with the selectable values of "Removal" and "Installation". I would like to change another combo box (cbo2) value list based on the selection in cbo1. For example, when the user selects "Removal" from cbo1 I would like the value list of cbo2 to be one set of values and when "Installation" is selected in cbo1 I would like the value list of cbo2 to be a different set of values. Is this possible? Thanks in advance. Troy Lee troy_lee@comcast.net wrote: > I have a continuous form that has one comb...

filling combo box based on previous combo
I have a continuous form with 3 comboxes, combo1, combo2 combo3. The choices in combo2 are dtermined the what is selected in combo1 by using a where = combo1 statement. The combo is refreshed with code, i.e. . The combo are freshed with code on after update of previous combo. SO combo1 after update might be me.combo2.requery. It works well to fill in the combo box with the choices, but problem is when I go down to the next record in the continuous form and select comb1 record 2 it requeries and removes the data from combos in record 1. Any body have any ideas here..there must be a simpl...

Populate a combo box based on a selection in other combo box on same form
Hi all, In a project I am doing at work, we are producing different types of deliverables. Each deliverable has an occurance in tblDeliverable. Each deliverable has one or more versions, which are stored in tblVersion. Each version belongs to exactly one deliverable. We are doing some test work on the deliverables now, and when something is wrong we record an action (tblAction). Each action is done to exactly one deliverable. I have a form to edit the actions (frmAction). In this form I have a cboDeliverable with a lookup to tblDeliverable. This is how we registratie to what deliverab...

Fill text box based on combo box selection
Okay this one has me stumped. I have a table called Review_Statements with the following columns: statementid type statement1 statement2 statement3 I have a form called SR_Review with an unbound combo box control (rationale_type) that is based on the statementid and type field of the table above. I also have another text box control on the same SR_Review form called rationale. This field is bound to field called "rationale" in another table called SR_Reviews. Here is what I *want* to take place. The user makes a selection in the rationale_type combo box, and based on the statemen...

Excluding Previously selected Combo Box record to current Combo Box
I have a form for transfers, which has on it 2 combo boxes, each with the same list of locations in them. I want combo box 2 to include all the locations apart from the one selected in combo box 1. E.g. A user can't transfer something from NY to NY. Can anyone suggest how I do this? Thanks in advance Will, just exclude the value in your combobox (cbo1) from the result set of your query for combobox2. Something like this: (tblRowSource) is whatever your current query is. SELECT .... FROM tblRowSource WHERE ... AND tblRowSource.Field<>Forms!MyForm!cbo1 Let's say you have ...

select 2 combo boxes to fill other text boxes
Hi, there, I am a beginner on Access. I have been taking so long time to try to figure out his, but so far, no clues. I want to select 2 combo boxes and Access will automatically fill in other 5 bound text fields for me. I searched all groups and microsoft support sites, no result. The 1st combo is "Capacity", the 2nd combo is "Door", I want to change 2 combo boxes with different selections, the 5 text boxes value will be changed accordingly. The form is based on a query which combine 2 tables together. That is, I can not change the form's source to another query. A...

Populating text box based on combo box selections
I have a form that contains two combo boxes that are related to each other. I need to find a way to populate my text box based on the criteria of the two combo boxes so the appropriate number appears in the text box. "SHAWTY721" <u38136@uwe> wrote > I have a form that contains two combo boxes that > are related to each other. I need to find a way to > populate my text box based on the criteria of the two > combo boxes so the appropriate number appears in > the text box. It's just not possible to be very helpful with the information you provided (Whi...

selecting list box entry using a combo box
I have a combo box that lists street numbers. I also have a list box that lists street numbers and addresses (separately). I want to click on one of the street numbers and have the first item in the list box with that street number selected. Any suggestions will be appreciated. Deborah Hi Deborah, Not going to ask you “why use a listbox?”. But here goes… Use this air code in you combo box afterupdate event. Assuming both control in the same form. Me.ListBoxName.RowSource = “SELECT StreetNumber, Addresses,…..FROM Table1 Where StreetNumber = “ & Me.ComboxName I’m assuming your Stre...

MS-Access Combo Box To List
Hi Group, I was trying to link a combo box with a list control and having some trouble with that. Could anyone please help me with that. Here's the example of the scenario. Combo Box ;- Country_Names (Pulls values from the country table(Just the country_name value)) (Each country will have a table by itself, For Example USA will be a table and it will have fields like "Area", Population", "States", "Major Cities", "Males", "Females"...etc." the fields vary from country to country. USA will have 20 Fields where as Japan will hav...

Combo Box to List Box
I have a combo box that gets it's values from a table. For example: ID Name 1 Book 2 Magazine 3 Novel I have a list box that displays a list of records. When the user adds the record a want the list box to be updated with the values from my fields including the combo box. The problem is, the value of the combo box (depending on the selection) is 1, 2, or 3 and that is what is displayed in the list box. I know it is an easy problem, but how do I get the list box to display 'Book' instead of 1. The default property .Value of the ComboBox is .Column(0) To refer to an...

Datasheet View: Second Combo Box Criteria Based on First Combo Box Value
Hello, I need a query that will determine the values in a dropdown box (Module), based on the value chosen in another dropdown box (Dir). SELECT Modules.Module FROM Modules WHERE Modules.Directory=Dir.Value; Tried: Dir [Dir] [Dir].Value Me.Dir Me.Dir.ListBox etc. I'm sure others must have successfully accomplished this. Many thanks if you can help me!!! Otherwise, I'm giving up. Rosalie Tackett ...

Selection lists (combo boxes) and large databases
I'm testing a user's db that contains a very large number of records. I have an invoice screen, with an invoice select dropdown box that shows all invoices, and the customer's name, etc. With 80,000+ invoices in this particular db, clicking the dropdown is painfully slow accross a network only (I'm testing on a wireless, so it's even slower still). All fields are properly indexed, such as the invoice number (sort descending), etc. I've noticed the Top Values property of the stored query, and this seems basically useless. If you set it for top 5%, it does run the ...

Requery Combo Box Clears All Combo Boxes
I have a subform that has a datasheet in it. In the datasheet I have multiple records. Each record has many textboxes and combo boxes. I have a particular combobox with 2 columns, Column 1 has the ID, Column 2 the description (The ID is hidden) (We will call this combobo cmbDescription). The combobox in question is dependend on a different combobox in the record (we eill call this combobox cmbCriteria) When I enter the cmbDescription I have some Code that goes like this. If Not IsNull(fldCriteris) Then GlobalCriteris = fldCriteria cmbDescription.Requery End If The cmbDescription uses...

Multiple Combo Boxes as well as multiple Multi select List Boxes to report
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just not several, to report using this code i found - Private Sub cmdPreview_Click() On Error GoTo Err_Handler Dim varItem As Variant 'Selected items Dim strWhere As String 'String to use as WhereCondition Dim strDescrip As String 'Description of WhereCondition Dim lngLen As Long 'Length of string Dim strDelim As String 'Delimiter fo...

Access 2003 post SP3 hotfix
"Combo box controls and list box controls display no value or incorrect values in Access 2003 after you install Office 2003 Service Pack 3." And a few more problems SP3 introduced. Description of the Access 2003 post-Service Pack 3 hotfix package: December 18, 2007 http://support.microsoft.com/kb/945674 Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can read the entire thread of messages. Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog...

Combo box fills text box
Hello again, I have a form that fills a text box with data according to the selection in the combo box. Two questions please: 1) The combo box does not have a control source so when opening the form, the combo box is empty but the text box already contains the first record. What do I need to do to either have both the combo box and text box empty on open or have both contain the first record on open. (If it takes VBA code, please point me in the right direction as I have not worked with it since '99). 2) I'm getting a runtime error 3077 on one of the records. I checked it to see i...

value in list box or combo box
i would like to use combobox or list box in a form for data entry do i have to have a table with value in it and the combobox or list box should look in to that table or i type in the values. 'cause when i create a form with text box and change it to combobox the box is empty there are no records in it . On Apr 12, 10:29 am, "access baby" <nishkr...@gmail.com> wrote: > i would like to use combobox or list box in a form for data entry do i > have to have a table with value in it and the combobox or list box > should look in to that table or i type in the values. &...

fill combo based on selection of other combo
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 by just presenting the projects the selected user is working on (using a where clause with the userid filled in). Does onyone know how to achieve this? Kind Regards, Antoine Janssen Use the OnChange event to trigger a query to get and populate the "Projects" combo box. You will need to have the userid included in the user combo box. When the user name is chosen this triggers the OnChan...

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...

How to reference one combo box from another combo box
Hello, I have an HTML file that contains a form with 2 selection list (combo box). The first combobox 'onchange' function, addColor(),adds a new color to the second combobox. I have half of the function build, but im missing the how to reference one combobox from another combobox. I've tried using the getElementById with no success. This is how the form with the 2 combobox looks like: <form> <select name="cars" size="1" onchange="addColor(???)"> <option value="Volvo">Volvo</option> <option value="...

Making combo boxes change options in other combo boxes
Hi, On my form I have one field of "City", and this in turn needs to effect "Township". When township is selected, the next field is distance, and for every 'township' there are 2 distances available to pick. (i.e. Washington brings townships 1-5, then township #1 has distances of 23Miles or 36Miles). How do I: 1) Make sure when a city is selected, only the townships in that city show up in the next drop down box. 2) Once a township is selected, there are basically 2 options in the next drop down box that should show up. What's the best way to do this? T...

Populate multi-list box based on selections in a different multi-list box
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on a table called COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME. The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES. I want to populate the course list box based on any category(s) selected in the 1st multi-list box. How would I go about doing something like this? Joe wrote: > I have 2 multi-list boxes, 1 displays course categories based on a > table called CATEGORIES. Th...

Populate text boxes with combo box selection
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be achieved. godber wrote: > I need to populate text boxes for instance with employee information > using their unique employee works number selected from a combo box. > Can anyone help, I am told thru visual basic this can be achieved. You can do it without VBA. Add extra columns to the combo box Set the width of the columns to 0 if you want to hide them In the text bnoxes you want to show the...

multi item combo boxes or list box
I am new to Access having used Filemaker for many years. My question has to do with displaying and creating a line item database. What I have is a two tables. One has Name, Location, time, disposition and Offense. The second has Offenses and Description of Offenses. I want to display, on a form, all the fields in table one with the Offense field, a drop down, combo box or list box, able to display more than one item. For example, if the user chooses in the drop down box 59FC, then 59FA, then 59NS. These would show on the form all the choices, preferably under each other. I am thinking a third...

Web resources about - Fill combo/list box based on previous combo box selection? - comp.database.ms-access

Selection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Australia v New Zealand Test cricket: Selection dilemma – Peter Siddle, James Pattinson or Chadd Sayers ...
Australia's selectors have to choose between picking an injured quick, the one coming back from injury or another who has not played at all for ...

Dumped Maroons still eligible for Australian Kangaroos selection
Their State of Origin hopes may have been dashed but the banned Queenslander's could still represent the Kangaroos this season.

Canberra Raiders coach Ricky Stuart faces 'welcome' selection headache
It's a headache Ricky Stuart, or the Raiders for that matter&nbsp;haven't had for a long time - the prospect of telling deserved players they ...

Canberra Raiders coach Ricky Stuart faces 'welcome' selection headache
It's a headache Ricky Stuart, or the Raiders for that matter haven't had for a long time - the prospect of telling deserved players they won't ...

AP PHOTOS: A selection of pictures from the past week - ABC-7.com WZVN News for Fort Myers, Cape Coral ...
By The Associated Press Highlights from the weekly AP photo report, a gallery featuring a mix of front-page photography, the odd image you might ...

"The scenario that the left would most favor and the right most fears would be the selection of a barrier-breaking ...
"The name most frequently discussed in this situation is Attorney General Loretta Lynch, who would be the first black woman to serve on the court. ...

Watchog Or Lapdog? Emails Show Hillary Had A Hand In Inspector General Selection
Watchog Or Lapdog? Emails Show Hillary Had A Hand In Inspector General Selection

Bodega Bagel Taste Test: Sietsema Reviews a Selection of Bodega Bagels
Eater's critic makes notes on a variety of bagels from local bodegas. Not all bodega bagels are created equal. There's an estimated 12,000 independently-owned ...

Chrissy Teigen Chose Her Baby's Sex During IVF: Here's What You Need to Know About Gender Selection
Chrissy Teigen Chose Her Baby's Sex During IVF: Here's What You Need to Know About Gender Selection

Resources last updated: 2/25/2016 7:22:41 PM