Deselect Listbox

D

DS

I'm using the following code to deselect a selection in a single select
listbox. It works but it always leaves a small line. Any to get rid of
that line?
Thanks
DS

Private Sub ListSections_DblClick(Cancel As Integer)
Me.ListSections = ""
End Sub
 
A

Allen Browne

Try setting the value to Null instead of a zero-length string:
Me.ListSections = Null

Probably not relevant this time, but the code in this link will clear all
selections in a multi-select list box, or set the value to Null if it is
single-select:
http://allenbrowne.com/func-12.html
 
D

DS

Allen said:
Try setting the value to Null instead of a zero-length string:
Me.ListSections = Null

Probably not relevant this time, but the code in this link will clear all
selections in a multi-select list box, or set the value to Null if it is
single-select:
http://allenbrowne.com/func-12.html
Thanks Allen.
Same thing happens with Null. Wherever I deselect the ghost line goes
to the top of the listbox.
Thanks
DS
 
H

harry.martin

The information in this worked for me. Thank you very much. I had one
posted today 08-11-06 that this resolved. Mine was called After a List Box
is chosen, Use a cmd button, the List Box is not selected.

Thanks,

Harry
 

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