Correct use to init a listbox: .Selected or .Value?

M

Max Moor

Hi All,

This is probably a really simple thing, but I just don't seem to get
it. I want to force a record to be selected in a listbox (no multiselect),
then requery a form that is based on the listbox.

I thought I could use the .Selected property, like:

Me!lstItems.Selected(0) = True

but it doesn't seem to set the value. If I do:

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

it works. I guess I'm wondering two things. First, if the .Selected
property doesn't set the value, is there much use for it if not using a
multiselect listbox?

Also, what is best common practice for doing this? Is the .Value /
..ItemData combination as good as any?

Thanks & Regards,
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