How to clear text of drop-down list combobox 
Author Message
 How to clear text of drop-down list combobox

Could somebody please tell me how to clear out the text of a combo-box with
a drop-down list style. If I try setting the text to "" then I get an error
message saying that it is read-only.

I want to be able to do this without clearing the combo-box list (just want
to clear the users previous selection, not the list contents).

It would be greatly appreciated if answers could be mailed to

Many thanks.



Sun, 21 Jul 2002 03:00:00 GMT  
 How to clear text of drop-down list combobox
Hi Rombert,

To reset the selected item in a combobox just set the

   combobox.listindex = -1

this should do the work.

Regards
Johnnie.



Sun, 21 Jul 2002 03:00:00 GMT  
 How to clear text of drop-down list combobox
That should work fine.. try this example Make sure you have "" not " "

Private Sub Command1_Click()

Combo1.Text = ""

End Sub

___________________________________

Private Sub Form_Load()

For x = 1 To 10
Combo1.AddItem "item " & x
Next

Combo1.ListIndex = 0

End Sub

HTH

Matt



Sun, 21 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to clear text of drop-down list combobox

2. Drop-Down List (ComboBox) and Text Box questions

3. Clearing a dropdown list (ComboBox)

4. Drop Down List Box - Drop Down portion does not always disappear after Click event

5. Combobox used as a drop down list in a datagrid

6. drop down the list in a combobox programmatically

7. Combobox / Drop down list

8. User Input for ComboBox Drop Down List

9. Converting Doc Form to HTML Loses Drop-Down (ComboBox) Selection Text

10. How do I make a ComboBox with a drop-down wider then the ComboBox

11. Disable IE5.5 drop down list when I type text within a web page - PLEASE HELP

12. How to change text from drop down list automatically

 

 
Powered by phpBB® Forum Software