>I have search form with a listbox on it. The listbox is populated by a RowSourceType-SQL SELECT statement INTO CURSOR RowSource-cuRowSource. I can enter a partial search string and it finds my matching records. Then, I choose the item/record in the listbox and press the OK button. My listbox RowSource used to be "slister" which was an Array, but I changed it to an SQL SELECT statement and from INTO ARRAY to INTO CURSOR because ARRAY would not hold all of my SQL SELECT data.
>
>Here is the code in my OK button which returned a record that matched the chosen line item from my listbox. How I do accomplish the same thing when I no longer have RowSource slister RowSourceType ARRAY to refer too? Now I only have RowSourceType = SQL SELECT statement and RowSource = the SQL SELECT statement including INTO CURSOR cuRowSource. Here is my code from my old search form.
>
>mast_REC = recno()
>IF cmdSearchSW = .T.
> seekid = ALLT(slister(THISFORM.lstSlist4.ListIndex,1))+ ;
> ALLT(slister(THISFORM.lstSlist4.ListIndex,2)) + ;
> ALLT(slister(THISFORM.lstSlist4.ListIndex,3))
> SELECT master
> SET ORDER TO TAG incident
> SEEK SEEKID
> mast_REC = recno()
>ENDIF
>thisform.release
>
>
>Thanks for the help. I have the whole search form working, except for the OK button.
One thing about using RowSourceType of a cursor (i.e., 2 (alias), 3 (SQL Select), or 6 (fields) ) is that when the listbox ListIndex changes, the record pointer moves in the RowSource cursor.
So, replace the
slister(...)
references to the cursor fields names.
Insanity: Doing the same thing over and over and expecting different results.