Input box to update combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box with several choices in it including "other". I would
like to make it so that when the "other" option is selected, an input box
appears. When the user types in the details and presses enter, I want the
stuff they've typed to show as the selection in the combo box.

If that can't be done, then I'd like the input box to update a text box
below the combo box with the inputted data.

How to?
 
Private Sub Combobox1_Click()
if Combobox1.Value = "Other" then
res = Inputbox("enter special selection")
if res <> "" then
combobox1.Value = res
End if
End if
End Sub

Make sure the style of the combobox is fmStyleDropDownCombo
This is the default, so if you haven't changed it you should be OK.
 
BEAUTIFUL! Thanks heaps Tom :)

Tom Ogilvy said:
Private Sub Combobox1_Click()
if Combobox1.Value = "Other" then
res = Inputbox("enter special selection")
if res <> "" then
combobox1.Value = res
End if
End if
End Sub

Make sure the style of the combobox is fmStyleDropDownCombo
This is the default, so if you haven't changed it you should be OK.
 
Does this solution add the new text to the drop down menu? so that next time
you use the combobox that value will be present?
 
Back
Top