ListBox has 2 rows highlighted

  • Thread starter Thread starter L Mehl
  • Start date Start date
L

L Mehl

Hello --

A form contains 2 listboxes.

Listbox1's MultiSelect property is set to
frmMultiSelectSingle.

The choice from that listbox is used to populate Listbox2.

If the choice in Listbox1 results in Listbox2 having no records, clicking a
different choice in Listbox1 highlights both the original choice and the
second one.

Is there a setting or code I need to add to allow only one choice (or, none)
in Listbox 1 to be highlighted?

Thanks for any help.

Larry Mehl
 
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint
 
Thanks Dave


Dave Peterson said:
It sounds like it's a display problem.

Maybe you could verify it with a line like:

MsgBox Me.ListBox1.ListIndex

And if maybe you could refresh the user form with a line like:

Me.Repaint
 
Adding
MsgBox Me.ListBox1.ListIndex
at the start of the listbox Click event
displays only 1 integer in the msgbox (0,1,2,...)
So, the system thinks only one listbox entry is highlighted, when two are
highlighted.

Me.Repaint has no effect when added at the end of the listbox Click event.
Is that where you thought I should put it?

Thanks for any additional help.

L Mehl
 
There was a post a little bit ago about a list box showing duplicated values in
the list when scrolling down.

I remember that it was a pain to workaround.

Maybe you can use some of the code to repopulate the list each time it changes.

http://groups.google.com/[email protected]
 

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

Back
Top