By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

Populating Combo Boxes (post-Selection)

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.