Access 2003, how do I know if a listbox has no row selected?

H

H. Martins

Hi.

Say I have a textbox and a listbox.

The text box is not supposed to be clicked if one of the listbox rows
(anyone) has not not been selected.

How do I detect that no row has been previously (still, is) selected?

Thanks
H. Martins
 
B

Bob Quintal

Hi.

Say I have a textbox and a listbox.

The text box is not supposed to be clicked if one of the listbox rows
(anyone) has not not been selected.

How do I detect that no row has been previously (still, is) selected?

Thanks
H. Martins

You can use the Selected property in Visual Basic to determine if an
item in a list box is selected. Read/write Long.

So set the textbox enabled property to false, and change it to true
only after checking that the listbox has at least one row selected.
 
H

H. Martins

Hi.

I tried several ways and I couldn't get anything from
lstbxAlunos.Selected
I wonder why!

I tried something like
txtbxDebug = lstbxAlunos.ItemsSelected.Count
and it works ok. It returns 0 (zero) is nothing is selected.

Thanks
H. Martins
 

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