List Box Programming

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
 
S

Sandra Daigle

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
 
J

J.C.

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

.
 
S

Sandra Daigle

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

.
 

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