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.
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 t...How to reference one combo box from another combo box
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:
<select name="cars" size="1" onchange="addColor(???)">
<option value="...Update combo box when another combo box onchange event
I'm just trying to use access for the first time. I have used mysql
befor so I know i little about datebases.
I have imported some tables into access and i have some querys too. Now
I want to use one of the query to update a combobox whem I select an
option in anoyher combobox.
I can run the query but how do I get the result into the combobox? And
how do I update it?
If someone will answer
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***
On 24 Mar, 10:00, kalle <ka...@yahoo.com> wrote:
> I'm just trying to use access for the first time. I have used mysql
> befor so I know i little about datebases.
> I have imported some tables into access and i have some querys too. Now
> I want to use one of the query to update a combobox whem I select an
> option in anoyher combobox.
> I can run the query but how do I get the result into the combobox? And
> how do I update it?
> If someone will answer
You need to use the AfterUpdate or the OnChange event of the first
combo box, use whatever values you need to construct the SQL, and then
set the DataSource of the second combo box.
> I'm just trying to use access for the first time. I have used mysql
> befor so I know i little about datebases.
> I have imported some tables into access and i have some querys too. Now
> I want to use one of the query to update a combobox whem...Combo box dependent on another combo box, text part is blank
I have a form with several combo boxes, continuous form format, with
record source a query off an Item Table. The fields are Category,
Subcategory, and Color. I am displaying descriptions, not ID's, so I
have to convert the ID's from various lookup tables.
The combo boxes work fine except for subcategory, which is dependent on
category. Depending on category, the drop-down box for subcategory
will display different items. (for example, when Category is
Furniture, Subcategory will display drop-down list of 'Dresser,
Nightstand, Desk...". Without clicking on the drop...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:
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...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.
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...How to change the contents of a combo box based on another
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 F...Basing a Field list on another combo box
In a form I have 2 combo boxes, X's Row Source Type is a "Filed list"
and Y is based on a "Query". I wan to base X's drop down list on
what's selected from Y's list. Can anyone help me with this?
Thanks for your time and cooperation.
If I've understood what you want (show the list of fields that are in a
selected query), use the AfterUpdate event fo the list of queries:
Private Sub cboQuery_AfterUpdate()
Me.cboField.RowSource = Me.lboQuery
cboQuery is the list of queries.
cboField is the list of fields in the ...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 for this field type.
Dim strDoc As String 'Name of report to open.
'strDelim = """" 'Delimiter appropriate to field type.
See note 1.
strDoc = "Products by Category"
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
strWhere = strWhere & strDelim & .ItemData(varItem) &
strDelim & ","
'Build up the description from the text in the visible
column. See note 2.
strDescrip = strDescrip & """" & .Column(1, varItem) &
lngLen = Len(strWhere) - 1
If lngLen > 0 Then
strWhere = "[CategoryID] IN (" & Left$(strWhere, lngLen) & ")"...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
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
Tony's Microsoft Access Blog...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. &...How to access a combo box value by providing the selection string from another vi.
I have a lower level communication vi with a combo box. I'm using the strings&values property to initialize the combo box. When I select a string from the dropdown I get the corresponding value but when I pass in the same string from a caller vi I don't get the corresponding value. How can I access the value for the item I'm selecting from outside??
Perhaps you should just use the strings & values property node to them out of the combo box, then search the 1-D array of clusters for the string that matches the one you are looking for, then return the corresponding value. Since it sounds like you are trying to access the control programmatically, use the programmatic features that are available.
Maybe I'm mistaken in what you are trying to do, in which case please post some representative VI's.
Thanks Ravens Fan,
I did what you suggested. Looking at the text string property and searching the array for the correct value pair seems to work. I thought there was an easier way to access the values directly but this works too.
What Rob described is exactly the behavior I was observing in my vi. It is good to know this type of information since I'm an experience programmer but new to Labview and I'm not aware of this kind of behavior. Also thanks for the enum tip. It's kind of frus...Listbox based on text box and combo box.
On an unbound form, I have a combobox called 'cboproducttype' and a
text box called 'txtamountappliedfor'.
I have an Add button that I would like the user to be able to hit once
a product and amount applied for has been entered. This should
populate an unbound listbox to display their selections. A user can
select one or more sets of product types and the amount applied for.
They should also have the functionality to remove a 'set' if they made
a mistake without the need to rebuild the whole listbox of
Then - I want to loop through the listbox of select...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.
> 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...Filter List Box using Combo Box on a form
I've read some posts similar to this, but the SQL does not seem to
have the desired effect in my form.
I'm trying to filter a list box (lstOfficeClass) using a combo box
(cbxProfitCenter). The list box rowsource is a table (OfficeClasses)
that contains all the text fields "OfficeClass". The table also has
corresponding text fields "ProfitCenter".
I've entered the following into the AfterUpdate event for the combo
strsql = "SELECT OfficeClasses.OfficeClass FROM OfficeClasses ORDER BY
OfficeClasses.OfficeClass WHERE OfficeClasses.ProfitCenter = " &
lstOfficeClass.RowSource = strsql
When opening the form, all OfficeClass fields show as expected. After
selecting a ProfitCenter in cbxProfitCenter, the list box goes blank.
Generally it's easier to have the listbox reference the combobox from
the outset. After you update the combobox requery the listbox.
As has been discussed recently you can have the listbox criteria use a
"like" statement and, via a union query, put an "*" in the listbox
On Jul 15, 9:31=A0am, pthe...@hotmail.com wrote:
> I've read some posts similar to this, but the SQL does not seem to
> have the desired effect in my form.
> I'm trying to filter a list box (lstOfficeClass) using a combo box
> (cbxProfitCenter). =A0The list box rowsource is a table (OfficeClasses)
> that contains all t...select of select box will select multiple in another box
Im trying to do the following:
I have 2 select boxes, both are pre populated with data. The first box
is a single select box, the 2nd is a multiple select box. Depending on
the 1st selection, I want to have multiple values in the second select
<option> warm colors
<option> cool colors
<option> shades of grey
<select name=colors multiple>
If the user would selec...Setting the size of column widths of a combo box through Code and Searching Combo Box
I have a combo box on a form which is based on table tblMachine. On that
combo box I have four columns visible MachineNumber, description, location
and type. The bound column is the MachineNumber and this is not set to 0 as
the machines have its number on which means the user should know the machine
number. My problem is if the user doesn't know the number. I have a button
which changes the row source of the combo box to order by description, but
when the user starts to type the description the relevant record does not
come up as machine number is still visible. Is it possible, when I...How to change the properties of Text box depending on the value of combo box.
Hi, I have created a combo box with "", Yes,No so that if user
select any other option except Yes the text box should become
disabled. For this I have written code in the exit event of the combo
box it is working . But the problem is that, after reopening the form,
if you navigate to same record it shows the check box enabled.
Can anyone help me how to solve the problem.
Try using the same code in the 'On Current' event for the form. At
present your code works ony if you exit the combo box, so when you open
the form it won't run. With the 'On Curr...Access 2007 combo box change event
Using Access 2007 Windows XP
I have a form with, among other things, two combo boxes. The form and
both combo boxes are unbound. I have code running in the change event
of the first combo box that updates the RowSource property of the
second combo box to something like:
"SELECT Field2 FROM TableA WHERE Field1 = " & Forms!FormName!
FirstComboBox.Value & " ORDER BY Field2 ASC;"
A client recently reported a bug in that the data in the second combo
box is not loading properly, using Access 2007. This cannot be
duplicated in either Access 2000 or 2003.
When the form is first opened, if the tab order is used to navigate to
the first combo box the code running on the change event shows the
Value and Column(0) properties as null, and the expected value for the
Text property. Once the second combo box has the focus, the Value,
Column(0) and Text properties of the first combo box all contain the
expected values. However, if the mouse is used to navigate to the
first combo box, the Change event then shows the correct values in all
I'm unable to find any documentation of this behavior here or
elsewhere. Is this a bug? A change in the behavior of a combo box?
...Limiting items in combo boxes based on another
Does anyone have experience with limiting items in one combo box
based on the selected item in another? I figured out how to do it,
but now I need to complete the hierarchy I am building and link 2
additional combo boxes. I am a new Access user.
My problem is the third combo box cboJobRole. It does not display any
items, and does not appear to be limited by the second combo box
My first combo box sql is:
SELECT [Career Families].[Career Family], [Career
FROM [Career Families]
ORDER BY [Career Families].[Career Family];
My second combo box sql is:
...Referencing a toolbar combo box in MS Access
Is there a way to determine the value of a combobox that resides in a
toolbar other than using CommandBars.ActionControl? I want a user to
be able to change the combobox and be able to refer to the selected
value later, not immediately, and without having to set a public
This refers to the toolbar when adding a combobox to the toolbar:
But what referes to the combobox once it's created?
Any help is appreciated.
I found a way to do this for anyone who had the same question:
Dim objBar As CommandBar, objCbo As CommandBarComboBox, myIndex As Integer
Set objBar = Application.CommandBars("myToolbarName")
Set objCbo = objBar.Controls("myComboName")
myIndex = objCbo.ListIndex
Set objCbo = Nothing
Set objBar = Nothing
email@example.com (Lauren Quantrell) wrote in message news:<firstname.lastname@example.org>...
> Is there a way to determine the value of a combobox that resides in a
> toolbar other than using CommandBars.ActionControl? I want a user to
> be able to change the combobox and be able to refer to the selected
> value later, not immediately, and without having to set a public
> This refers to the toolbar when adding a combobox to the toolbar:
> CommandBars("myToolbarName").Controls.Add(Type:=msoControlComboBo...Unbound combo box: I can't select an item in the box
I have a strange problem. When I put a combo box into
a form, and set a row source, when I display the form
I can pull down the list of items, but when I select an
item it does nothing. It doesn't call the event handler
it doesn't select the item into the combo box: nothing.
The combo box is unbound. I didn't change the properties
of the combo, just the default ones the control wizard
I think I have done this many times before, but this is
the first time I tried with Access 2002, am I doing
something really dumb? And if so, what can I do to fix
&q...Select records based on three different combo boxes
How can you select records based on more than one combo box -
I have a combobox that selects records based on name
(I'm sure this has been asked a thousand times - web site answer/link
could be helpful too; but I'm so bad with syntax that specifics will
be MOST helpful)
SELECT DISTINCT [qryAE_ProtocolsSponsors].[PI Last Name],
[qryAE_ProtocolsSponsors].[PI First Name] FROM
[qryAE_ProtocolsSponsors] Union Select "<ALL>" , NULL From
and sorts the results:
If Me![Combo24] = "<All>" Then