Form Dropdown box with "Other" option

  • Thread starter Karol Brown via OfficeKB.com
  • Start date
K

Karol Brown via OfficeKB.com

I would like to create a drop down box in a form that provides for the most
common responses, but allows the user to also select "Other." If "other"
is selected, I would like the word "Other" NOT to appear, but to allow the
user to fill in the text in the form.

Do you know if this is possible? If possible, how do I do it?

Thanks in advance,

Karol Brown
 
G

Greg Maxey

Karol,

Posting this only to demonstrate that it can be done. I believe that a
userform with a combobox (designed for just this sort of thing) would be
more appropriate. Run the following as an on exit from your dropdown field

Sub ScratchMacro()
Dim myString As String
Dim oDoc As Document
Dim i As Long

'normal list has 4 items. Other being the last entry
Set oDoc = ActiveDocument
If oDoc.FormFields("Dropdown1").Result = "Other" Then
myString = InputBox("Type your selection here:")
For i = oDoc.FormFields("Dropdown1").DropDown.ListEntries.Count To 5
Step -1
oDoc.FormFields("Dropdown1").DropDown.ListEntries(i).Delete
Next
oDoc.FormFields("Dropdown1").Result = myString
End If
End Sub
 

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

Top