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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add buttons and comboboxes that function using a WORD Macro

Status
Not open for further replies.

nochoice

Programmer
Jun 17, 2003
72
CA
Hi There,

Here is what I'm trying to do:

I have a combobox and 3 buttons associted with the combobox

1)add - Adds an entry
2)remove - Remove an entry
3)remove all - Removes all entries

Let's call these 4 objects a Group

I have 2 groups.

I can easily remove a group.

My problem is adding a group. Here is the code I'm using to Remove an entry:


Private Sub Rem1_Click()
ComboBox1.RemoveItem (ComboBox1.ListIndex)
ComboBox1.Value = ""
End Sub


Add and remove and remove all have similiar code. I can simply copy and paste a group using a Macro, but the Macro Code isn't copied and the names of the buttons are changed. So I would physically have to change the code to add another group. This is no good.

Some Thoughts I had, but don't know how to implement:

1) Have many comboboxes but only one add, remove, and remove all buttons. The add, remove, remove all buttons check to see which combobox is selected and manipulate that box, this way everything is soft it makes no difference what the combobox's name is.

Any Suggestions/ help would be appreciated.

Thank you in advance,

NoChoice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top