>Hi Cetin
>
>>myListbox.listindex = 1
>
>ListIndex was not available at design-time so I set it up in myListBox.Init() and it worked. Thanks a lot. Also this listbox does not really have a control source, is it necessary? It is working anyway.
>
>While we are at it, also the next time round when this form is opened the index reverts to the first record anyway I can get it to stay the next time round in the last selected record. I have stored the iID of the record in the form for current usage and then later stored in the goApp application object. Anyway to make it remember the selection?
>
>Please advise.
No doesn't need any controlsource.
You could set it in form.init. If rowsourcetype is something that's a cursor (fields,SQL,quer,alias) then as you move in listbox you're moving the pointer in listbox (listindex = 1, recno() of underlying cursor is 1)
I generally use RowSourceType=3 - SQL. As I move in its cursor I simply set:
myListBox.ListIndex = recno('cursorName')
Cetin