Clearing a combo box

V

Vayse

I have a databound form, frmClients. One of the field is a combo box,
comDepartment, which lets a user select a department for the Client.
But I can't figure out how to clear the box. That is, sometimes a Client is
dropped by a Department. How would a user clear the combo box so that no
Department is selected?
With the combo box dropdown style:
Dropdown: User must pick from the list, so there is no way of clearing the
box
Dropdown List: User can type a value. But even if the user deletes the
value, it won't be saved.

Suggestions please.
Thanks
Vayse
 
G

Guest

Vayse,

I'm not sure I understand what you mean by clearing the combo box.

However, if you want to de-select the currently selected item, so that
nothing is selected in the combo box:

combobox1.SelectedItem = Nothing

or

combobox1.SelectedIndex = -1

or

combobox1.SelectedValue = some value not contained in the values collection

Kerry Moorman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top