Single Item ComboBox ?

  • Thread starter Thread starter Jay Wilson
  • Start date Start date
J

Jay Wilson

I have a form that has 2 combo boxes on it. The selections for combox2
dynamicly change based on what is selected from combox1. If combox2 only
has a single selection available, I want to automatically have combox2 use
it without me type anything. How can I do this?

I thought I could do the following, but it doesn't do what I want. I made
sure "Column Heads" is set to No. I know the "If" condition has been met,
because I traced the execution, but I never see the Value appear in
combox2.

If Me.Combox2.ListCount = 1 Then
Me.Combox2.Value = Me.Combox2.Column(0)
End If



Thanks
 
I have a form that has 2 combo boxes on it. The selections for combox2
dynamicly change based on what is selected from combox1. If combox2 only
has a single selection available, I want to automatically have combox2 use
it without me type anything. How can I do this?

I thought I could do the following, but it doesn't do what I want. I made
sure "Column Heads" is set to No. I know the "If" condition has been met,
because I traced the execution, but I never see the Value appear in
combox2.

If Me.Combox2.ListCount = 1 Then
Me.Combox2.Value = Me.Combox2.Column(0)
End If
do you mean?
If Me.Combox2.ListCount = 1 Then
Me.Combox2.Value = Me.Combox2.ItemData(0)
End If
 
See my reply to your first post with this same question.

Ken

I appoligize. My news server never showed the first posting going out
successfully and it never saw your response. Would you please repost your
response?

Thank You
 
Here it what I'd posted earlier:

Try this to set the combo box to the first item in the list:

Me.ComboBox2.Value = Me.ComboBox2.ItemData(0)
--

Ken Snell
<MS ACCESS MVP>
 
Back
Top