Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox 'selected' property problem

Status
Not open for further replies.

ormsk

Programmer
Sep 30, 2002
147
GB
I am running Access 97.

I have a listbox and I want my app to select the first item in the list, so I issue the command:

Me!lstClubs.Selected(0) = True

Then I run a procedure that uses the a value in one of the columns in the list. However, the first item is selected ok and the procedure runs to competion,but then all the controls appear to be locked in some way.

I have encountered this before and put it down to a quirk in Access, but I could do with knowing if there is a work-around, or whether I have missed something.

Can anyone help?
 
Hi Ormsk,

You could try:

Me.yourlistbox.SetFocus
Chr (13)

I think that the set focus method is available in Access 97. This will set the cursor to your list box and the carriage return will select the first item.

Try putting this on your formload event.

Hope that it gets you started.

Regards,

Brian






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top