Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Form Combo Box - How do I enter the values in the drop down

Status
Not open for further replies.

Sandman007

Programmer
Jun 20, 2001
47
US
I've inserted a combo box. How do I enter the values in the drop down?

Thanks!
 
There is more than one way to do it.

ActiveX ComboBox:
Go to design mode. Right Click the properties. Enter the range that contains the values you want to appear in the combobox in the "List Fill Range" property.

Forms ComboBox:

Right Click the combobox in the input range, enter the range that contains the values you want to appear in the combobox.


You can also fill them with VBA code. If you want to go with that approach then let me know.

HTH,
Eric
 
I'm still kind of lost. I don't see the "list fill range" in my properties. Basically I just want the drop down to have "yes" "no" "maybe" as options.

Maybe VBA?

Thanks for your time and help
 
My mistake. I should read the post better. My answer was for Excel.

Using VBA this will add the item "Hello" to your combobox.

YourComboName.AddItem "Hello"

HTH,
Eric

 
This is what I tried. Still nothing showing.

Private Sub ComboBox1_Click()
ComboBox1_Change.AddItem "Hello"
ComboBox1_Change.AddItem "Hello2"
End Sub
 
put this code in your Workbook_Open() event:

ComboBox1.AddItem "Hello"
ComboBox1.AddItem "Hello 2"

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
I don't have such an event. This is in Word. Thanks for all your help.
 
I think that he means the Document open event.

Private Sub Document_Open()
ComboBox1_Change.AddItem "Hello"
ComboBox1_Change.AddItem "Hello2"
End Sub

You would think that the on click event would fire when you click on the combo but it doesn't. Placing the code in the On open event will add the values to the combo each time that you open the document.

HTH,
Eric
 
So then put it in your Document_Open event!

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
In the properties of your combo what is the exact name of the combo? Also you will need to set your macro security to medium for the code to run.

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top