combobox no selection

R

RedBeard

How would I go about creating a command button that resets a combo box
to a "pristine state" i.e. nothing selected?

Thanks!
 
J

John Spencer

If your button is on the form then the click event would have this line of code

Me.NameOfCombobox = Null

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
D

Dirk Goldgar

RedBeard said:
How would I go about creating a command button that resets a combo box
to a "pristine state" i.e. nothing selected?


The others have pointed out how to clear a normal combo box. If you are
using Access 2007, and your combo box is bound to a multi-value field and
allows multiple selections, then that method won't work. If that is the
case, you can clear the combo box by setting its value to an empty array,
like this:

Me.MyComboBox = Array()

Remember, that will only work, and will only be necessary, if the combo box
supports multiple selections.
 

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