Link to home
Start Free TrialLog in
Avatar of Jim Horn
Jim HornFlag for United States of America

asked on

Access listbox: VBA to select an item

Hi guys

I have an Access list box that populates fine.  No rows are selected.
Example:   "apples", "oranges", "bananas", "watermelon".

Question:  What is the VBA code to programmatically select an item (say "bananas") in the list box?  

I see the .ItemsSelected property, but it seems to only apply to all items selected.  

Thanks in advance.
Jim
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jim Horn

ASKER

Both work, although I went with Cap's as I forgot to mention that while I have "bananas", the bound column in the listbox was basically the FruitID.  Thanks.  -Jim
btw ... is there just one column in the list box ?
There were five, but I butchered the example.