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

Add/Change/Delete Cbo Box

Status
Not open for further replies.

Kreiss

Programmer
Oct 8, 2003
48
0
0
US
Is there a way or code to be able to use a combo box so users can add, change or delete items from it. What I am hoping for is like in the design view of VB under the list property you can add, change or delete from the list. What I would like to do is have on the form where users can do this with the combo box.

Thanks in advance,
Kacy
 
You can leave the combo box empty and have a hidden textbox below it containing your items. When the user clicks on the combobox (probably in GotFocus event) make the text box appear. Then on LostFocus of the textbox hide again. Would probably be good to have the items in a hidden list and update in each of these events...

Just a thought

Matt
 
You could do something in the LostFocus event, like MattSTech said...however leave "Style" to "0 - Dropdown combo"; when focus is lost, check if .Text is already in the list, if it's not then added it--or if focus is lost and .Text is empty, remove the last selected item from the list.

You might want to have something in the Change event too...maybe the whole thing should be processed there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top