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

Reset Listbox to Null???

Status
Not open for further replies.

Jen123

Technical User
Mar 9, 2001
64
GB
Hi,

I have a listbox and I want to use the "on double click" to run some code. This is working fine but I can't seem to reset the list box to null when I have selected the first value as I want to run different code, if a value isn't selected. Can this be done?

Cheers
 
Have you tried running a requery on the listbox?

Me.lstWhatsItsName.Requery

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Yes - certainly have. No luck

I've also tried resetting the .value, and .selected to no avail.
 
The code for selecting an item in a listbox is:

Me(ListBoxName).Selected() - I would think there would be someway of deselecting using this.

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
I had the same problem and the following worked for me...

Dim i As Integer
For i = 0 To ListBoxName.ListCount - 1
ListBoxName.Selected(i) = False
Next i
 
Cheers for this.... I eventually got it working with this

lstboxName.Value = Null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top