Clearing previously selected listbox items

  • Thread starter Thread starter Jacob Frankham
  • Start date Start date
J

Jacob Frankham

Hi All

I have a form which contains several listboxes, some of which are
single-select only.
It is these which I have the problem !

If I go through the list boxes for the FIRST time and I subsequently clear
the screen (command button which de-selects all of the previously selected
items and sets the focus back to the first listbox), and then go through the
listboxes again, the previously selected items are highlighted in blue (not
selected, just highlighted)!

How do I stop access 'remembering' what was previously selected so that it
won't highlight it.

This is not a problem for ME, but users might think that it is selected and
will be wondering why the 'Preview Report' command button remains disabled
when the criterion appears to be selected (highlighted) when in actual fact
it is not

Hope someone can help

Cheers

Jake.
 
You can set the Selected property of each row to False:

For intI = 0 To Me.lstBox.ListCount - 1
Me.lstBox.Selected(intI) = False
Next intI

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Ahh OK

Thanks again !

How do I make a SubForm look like a listbox though ??

CHeers

Jake
 
Why do you want to do that? What's the business problem you're trying to
solve?

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top