Reset multi select

T

TK

How do I reset the selections in a multi select list box in the OnCurrent
event of a form? I am using the multi select for choices for a report and
when they print the report and scroll to the next record in the dialog box,
the selections remain highlighted. I have tried resetting the .ItemsSelected
and the .Selected properties, but it does not like that at all.
Thanks in advance.
TK
 
S

Steve Schapel

TK,

Here's one approach...

Dim i As Integer
For i = 0 To Me.MyListBox.ListCount - 1
Me.MyListBox.Selected(i) = False
Next i
 
T

TK

Steve,
That worked but it didn't. It is true that nothing is selected anymore, but
to the user it looks like it is. The previous selection(s) are still
highlighted making them look like they are still selected. I tried changing
the focus to a different control in the OnCurrent event, but that did not
cause them to be unhighlighted.
Any ideas??
TK
 
S

Steve Schapel

TK,

That's strange. I just tried it out, and it seems to work for me as I
would expect. See if it helps to put Me.Repaint or Me.Refresh at the
end of the procedure.
 
K

Kemper

Hi TK,
Just requery the list box using a Macro or a Command Button and call it CLEAR SELECTIONS or somthing.

Kemper
 

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