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!

User editable entries in a UserForm ComboBox in VBA

Status
Not open for further replies.

phudgens

Technical User
Jul 8, 2004
117
US
I am filling a ComboBox on a user form based on entries made by the user in another page on the same user form. Once the combo box has been loaded, I would like the user to have the ability to edit those entries, line by line, if needed. I'm not finding a way to do that in a VBA combo box. Does anyone know of a way, or do I need to use some other device?
 
Kind of thought that wasn't really possible with a combo box. There's the Not In List event but I've never wanted to change a combo box line by line. Would it be easier to let them go back to the source, change it there and then requery the combo box?
Sorry. Probably going a little too quickly right now.
 
While it's probably not possible to edit a combo box in-line, you may be able to accomplish this with a text box. Select the item in the combo box you wish to edit, delete, or add next to. Type the new item in the text box, have 3 buttons (edit, delete, add) and update back to the source.
 
Thanks for your replies. I had thought that there would be an "on-the-fly" way for the user to edit entries in the combobox, once it has been populated. I assumed that that was what the display window was for - but it doesn't appear to work that way. I'll try the InputBox via the _Click trigger event. Thanks for the help.
 
I think the way to do it to load the contents of the ComboBox into elements of an array. Use TextBoxes and a spinner to cycle through the array elements, making changes in the TextBox and updating the array.

Rebuild the ComboBox contents from the array when finished.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top