>>I am still working on the listbox using array. I need to find what row the listbox is SELECTED. The listbox can vary with number of rows and upon clicking on the listbox, I need to know what row it is, so I can do the following:
>>
>>=SEEK(ThisForm.laSQL[1,1],"org","main")
>>
>>But the [1,
#] is what I need to find/fill-in the value to find the actual record in the real table.
>>
>>I hope my English is readable here?
>>
>>Chuck
>
>Chuck,
>
>Ok, let's continue... :) BTW, did you get the file I sent you?
>
>In order to find out, which item you select, the only known way (for me) is to loop through list items to check, if the item is selected, e.g.:
>
>
local lnI, lnValue
>with thisform.List1
>for lnI=1 to .ListCount
> if .selected(m.lnI)=.t.
> **
> lnValue=.List[m.lnI]
> exit
> endif
>next
>
>HTH
Oops, I was incorrect. According to Help file, it's much simpler:
? List(MyList.ListIndex)
See Help on ListIndex. I was thinking about multiselect listbox...
If it's not broken, fix it until it is.
My Blog