focus of a listbox

M

marco van haaften

How do I set the focus to a record in a listbox.

I have a listbox with items with a unique id. Given that I
have the id, how can set the focus to the particular
record in the listbox.

Just a tip would be usefull, thanks!!
 
A

Arvin Meyer

marco van haaften said:
How do I set the focus to a record in a listbox.

I have a listbox with items with a unique id. Given that I
have the id, how can set the focus to the particular
record in the listbox.

Just a tip would be usefull, thanks!!

Use the Selected property. For example, this selects the first item in a
list:

Me!Listbox.Selected(0) = True

The Selected property uses the row index.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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