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

unselecting selected items in a listbox 1

Status
Not open for further replies.

MBall2003

Programmer
May 30, 2003
61
0
0
US
is there anyway, to loop through a list box and if there is an item selected, unselect it??

any help would be appreciated thanks

mball
 
Hi, try this...

Dim intCount As Integer

For intCount = 0 To lstList.ListCount - 1
lstList.Selected(intCount) = False
Next intCount



There are two ways to write error-free programs; only the third one works.
 
Hi!

Use the following code:

Dim intRow As Integer

For intRow = 0 To Me!YourListBox.ListCount - 1
Me!YourListBox.Selected(intRow) = False
Next intRow

hth


Jeff Bridgham
bridgham@purdue.edu
 
i use that code and i get this error, lstClients_AfterUpdate[2115] The macro or function set to the BeforeUpdate or ValidationRule Property for this field is preventing microsoft access from saving the date in the field



i dont know what that means
 
What other event code do you have on this list control?



There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top