How can I force selection of the 1st record of multiselect listbox from VB

M

Max Moor

Hi All,

I'm still stuck on this. I have a multiselect listbox in Access 2002.
I want to force the first record to be selected from VB after the listbox is
requeried. As I understand it, the value property always reads Null in this
case. Trying to set it doesn't work, so I assume this is a two way street
for multiselects.

Can anyone help?

Regards,
Max
 
Joined
Feb 13, 2008
Messages
3
Reaction score
0
List Box

Try

Me!LstBoxName.Selected(0) = True

You would have to read it as

Me!LstBoxName.column(0,0) for the first column, first row
 
M

Mark A. Sam

Max,

If your listbox was named [myListBox] then the method would be

[myListBox].Selected(1) = True

God Bless,

Mark A. Sam
 
M

Max Moor

myListBox].Selected(1) = True

Hi Mark,

Well. That was rediculously simple. I had managed to get stuck on the
'Selected' property being read only. I even briefly considered that you were
crazy to even suggest writing it as a solution.

Of course, I have no idea where I got that idea now. I just got it in
there somehow, and couldn't see past it. Maybe it's time for a day away?

Thanks for the wake up call. :)

- 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