By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Select an item in a list box through vba

convexcube
P: 47
Hi everyone,

I have done some searches and come up with no definitive answer. Is it possible to select a specific item in a list box with vba code in Access 2007

Thanks in advance for your help,
Ken.
Feb 7 '08 #1
Share this Question
Share on Google+
3 Replies


convexcube
P: 47
I've discovered the answer:

Expand|Select|Wrap|Line Numbers
  1. lstListBox.Selected(Form_Records.lstListBox.ListCount - 1) = True
Kind Regards,
Ken Farrawell.
Feb 7 '08 #2

convexcube
P: 47
I've discovered the answer:

Expand|Select|Wrap|Line Numbers
  1. lstListBox.Selected(lstListBox.ListCount - 1) = True
Kind Regards,
Ken Farrawell.
Well at least that will select the last item in the list box, which in my case was the last added item and the one I wanted to select.
Feb 7 '08 #3

NeoPa
Expert Mod 15k+
P: 31,186
If you know the value of the line you want to select then I would suggest trying :
Expand|Select|Wrap|Line Numbers
  1. lstListBox = {value}
Not very sexy, I know, but works in earlier versions anyway.
Feb 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.