469,645 Members | 1,653 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 2906
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Derk | last post: by
1 post views Thread by Jeff_F | last post: by
reply views Thread by heimdal | last post: by
3 posts views Thread by Phil | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.