Benyaw
asked on
Default First Row in List Box
how do i make the first record in my list box selected....
i've tried [itemdata] & [selected] but no joy... i urgently need to solve this..
any help appreciated
thanks
benyaw
i've tried [itemdata] & [selected] but no joy... i urgently need to solve this..
any help appreciated
thanks
benyaw
Scott,
That will select the first item, but if you immediately print the value of the list, it will still be null. I use
Me.lst_Numbers = Me.lst_Numbers.ItemData(-M e.lst_Numb ers.Column Heads)
you could use 0 as the index # for ItemData, but if you have ColumnHeads turned on, it will not work, so I generally just use this all of the time.
That will select the first item, but if you immediately print the value of the list, it will still be null. I use
Me.lst_Numbers = Me.lst_Numbers.ItemData(-M
you could use 0 as the index # for ItemData, but if you have ColumnHeads turned on, it will not work, so I generally just use this all of the time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, you need two lines, one to set the value and the other to actually select the item in the list:
Me.lst_Numbers = Me.lst_Numbers.ItemData(-M e.lst_Numb ers.Column Heads)
Me.lst_Numbers.selected(-M e.lst_Numb ers.Column Heads) = true
Me.lst_Numbers = Me.lst_Numbers.ItemData(-M
Me.lst_Numbers.selected(-M
Scott,
you are correct, my bad. Have not had my coffee yet. I was thinking you had to set the value of the list as well, so I guess the 2nd line would suffice for all circumstances.
Me.lst_Numbers.selected(-M e.lst_Numb ers.Column Heads) = true
you are correct, my bad. Have not had my coffee yet. I was thinking you had to set the value of the list as well, so I guess the 2nd line would suffice for all circumstances.
Me.lst_Numbers.selected(-M
Me.YourListview.Selected(0