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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Input/combo box 2
combo box 2
User form Text Box & Combo Box. 5
Populate Combo Box 6
Combo Box Question 22
combo box - last value 2
Having trouble with combo boxes. 11
User Form / Text Box / Combo Box 7

Back
Top