List Box Programming

  • Thread starter Thread starter J.C.
  • Start date Start date
J

J.C.

I'm having some problems programming a list box on a Tab
Control page.

Is there a way to programatically remove the selection
highlight from a list box? I don't mean change or remove
the selected entry; instead, leave the list box with no
selection. I can't find a method available that will do
that.

jc
 
You have to do it by setting the selected property of each item in the list.

Dim intI As Integer
Dim lngMyValue As Long
For intI = 0 To Me.List16.ListCount - 1
Me.List16.Selected(intI) = False
Next intI
 
Sandra -

Yes, thanks, that'll work. Someone else sent me an email
suggesting that as long as Multi Select property is set to
None, setting the value of the control to null
accomplishes the same thing. Your routine works well,
however, if the Multi Select property is set to other than
None.

jc
-----Original Message-----
You have to do it by setting the selected property of each item in the list.

Dim intI As Integer
Dim lngMyValue As Long
For intI = 0 To Me.List16.ListCount - 1
Me.List16.Selected(intI) = False
Next intI


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


J.C. said:
I'm having some problems programming a list box on a Tab
Control page.

Is there a way to programatically remove the selection
highlight from a list box? I don't mean change or remove
the selected entry; instead, leave the list box with no
selection. I can't find a method available that will do
that.

jc

.
 
Interesting, I knew it would work when set to None - but for some reason I
was thinking of a multiselect listbox so I didn't suggest that (too
simple!).

So then I thought I'd test it with Multiselect and found that setting it to
Null works if it is Extended or None, but not when it is Simple. That
doesn't exactly make sense to me.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

J.C. said:
Sandra -

Yes, thanks, that'll work. Someone else sent me an email
suggesting that as long as Multi Select property is set to
None, setting the value of the control to null
accomplishes the same thing. Your routine works well,
however, if the Multi Select property is set to other than
None.

jc
-----Original Message-----
You have to do it by setting the selected property of each item in the list.

Dim intI As Integer
Dim lngMyValue As Long
For intI = 0 To Me.List16.ListCount - 1
Me.List16.Selected(intI) = False
Next intI


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


J.C. said:
I'm having some problems programming a list box on a Tab
Control page.

Is there a way to programatically remove the selection
highlight from a list box? I don't mean change or remove
the selected entry; instead, leave the list box with no
selection. I can't find a method available that will do
that.

jc

.
 
Back
Top