473,386 Members | 1,720 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.

Populating Combo Boxes (post-Selection)

I have 3 tables of information feeding into 4 combo boxes on my main
form (DR Form). I have as many list boxes (acting as text boxes) as
there are fields in each one of the 3 tables. Once selecting from the
combo box, I have all the combo boxes, using afterupdate, populating
their respective list boxes. These text boxes are directly correlated
to the combo box selection using SQL. Here is an example from the
afterupdate event in the sub cboServer_Click:

lstServername.RowSource = "Select [Server Name] From [Server List]
Where [Server List].[Server Name] = '" & Me.cboServer & "';"

So when I select something from 1 of the combo boxes, say cboServer
(where I have server names listed), the information in the other 3
combo boxes decrease and get specific to holding only the information
tied to that specific selected Server.

Now, when I select from one of the combo boxes, how do I get the
remaining unselected combo boxes to display the first instance that
can be chosen (instead of having the user select from the combo box to
display the one they want), disregarding whether or not they have 1 or
multiple instances to choose from?

Aug 1 '07 #1
2 3244
To have the first item in a combo box's Row Source be "showing" as already
selected in the combo box, this generic code will do:]

Me.ComboBoxName.Value = Me.ComboBox.ItemData(0)

--

Ken Snell
<MS ACCESS MVP>
"Dave" <dj*******@gmail.comwrote in message
news:11*********************@k79g2000hse.googlegro ups.com...
>I have 3 tables of information feeding into 4 combo boxes on my main
form (DR Form). I have as many list boxes (acting as text boxes) as
there are fields in each one of the 3 tables. Once selecting from the
combo box, I have all the combo boxes, using afterupdate, populating
their respective list boxes. These text boxes are directly correlated
to the combo box selection using SQL. Here is an example from the
afterupdate event in the sub cboServer_Click:

lstServername.RowSource = "Select [Server Name] From [Server List]
Where [Server List].[Server Name] = '" & Me.cboServer & "';"

So when I select something from 1 of the combo boxes, say cboServer
(where I have server names listed), the information in the other 3
combo boxes decrease and get specific to holding only the information
tied to that specific selected Server.

Now, when I select from one of the combo boxes, how do I get the
remaining unselected combo boxes to display the first instance that
can be chosen (instead of having the user select from the combo box to
display the one they want), disregarding whether or not they have 1 or
multiple instances to choose from?

Aug 1 '07 #2
On Aug 1, 4:21 pm, "Ken Snell" <kthsneisll...@ncoomcastt.renaetl>
wrote:
To have the first item in a combo box's Row Source be "showing" as already
selected in the combo box, this generic code will do:]

Me.ComboBoxName.Value = Me.ComboBox.ItemData(0)

--

Ken Snell
<MS ACCESS MVP>

"Dave" <djwest...@gmail.comwrote in message

news:11*********************@k79g2000hse.googlegro ups.com...
I have 3 tables of information feeding into 4 combo boxes on my main
form (DR Form). I have as many list boxes (acting as text boxes) as
there are fields in each one of the 3 tables. Once selecting from the
combo box, I have all the combo boxes, using afterupdate, populating
their respective list boxes. These text boxes are directly correlated
to the combo box selection using SQL. Here is an example from the
afterupdate event in the sub cboServer_Click:
lstServername.RowSource = "Select [Server Name] From [Server List]
Where [Server List].[Server Name] = '" & Me.cboServer & "';"
So when I select something from 1 of the combo boxes, say cboServer
(where I have server names listed), the information in the other 3
combo boxes decrease and get specific to holding only the information
tied to that specific selected Server.
Now, when I select from one of the combo boxes, how do I get the
remaining unselected combo boxes to display the first instance that
can be chosen (instead of having the user select from the combo box to
display the one they want), disregarding whether or not they have 1 or
multiple instances to choose from?- Hide quoted text -

- Show quoted text -
I'm much obliged. Thank you!

Dave

Aug 2 '07 #3

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

Similar topics

2
by: Derk | last post by:
I have to write a web page wht three combo boxes, all three are to be populated from a database. - there tables = Bulidings, Floors and Offices The user will choose a 'Building' from the first...
1
by: Jeff_F | last post by:
Hi all. Question in two parts. I'm looking to add two combo boxes. The first will contain regions and the second will contain employee names which correspond to the region selected in the first...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
0
by: heimdal | last post by:
I am new to VB. I have created a combo box in Visual Basic 2005 Express. I created this by dragging a field from a datasource across to the form as a combo box. However when I run the form I get...
3
by: Phil | last post by:
I've posted this a few times without any luck, hoping for some fresh ideas on this. I'm pretty certain this can be done. I've been using a micrsoft template to create a supplier database called...
2
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and...
11
by: jgoodnight | last post by:
Hi, I have a form with three combo boxes: Area, Sub-Area, and Factor. I've set up the Sub-Area combo box to list only those areas that are part of the selected area. I've set up the Factor combo...
2
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
We have many many systems (accounts) which we need to search on. What my initial Idea is to have a ComboBox1 populated w/ a list of all systems at load (from Oracle table). Done and quick But,...
3
by: PuddinPie | last post by:
Hello, I’m kind of new to Access 97 so please bear with me. I have a form with four combo boxes linked to a union query. It’s a start date, end date, User, and system What I am trying to do...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...
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.