ListBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,
I have a list box that is populated from a query.
I need to set the focus to the list box and select the
first item in the list.
I have tried the ListIndex method but I get an error that
I have used the ListIndex property incorrectly.
The listbox is named CustomerRoll on the CustInfo form.
This is my code:

Forms!CustInfo.CustomerRoll.ListIndex = 0

I know I have missed something simple here.
Any help would be appreciated.

Brian
 
The ListIndex property is read-only.

Try:

Forms!CustInfo!CustomerRoll.Selected(0) = True
 
Thanks Doug,
It works like a champ.
I was mislead by a line in the Access help that it was
possible to set the index value.

Brian
 
Back
Top