How to select first record in listbox?

M

Max Moor

Hi All,

I have a listbox set to multi-select. I sometimes resort the list by
rebuilding its SQL in VB code and requerying it. I then want to update the
form that relies in the selection in the listbox for its SQL, but nothing in
the listbox is selected.

I tried setting the listbox "Value" property with:

Me!lstItems.Value = Me!lstItems.ItemData(0)

but it didn't work. I assume this is either because the box is in
multiselect mode, so the bound column is inaccessible, or because I don't
know what the heck I'm doing.

So, how can I make the first record of a listbox in multiselect mode
get highlighted?

Thanks, Max
 

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