lcWhereCond = "" IF NOT EMPTY(thisform.text1.value) lcWhereCond = IIF( NOT EMPTY(lcWhereCond), " AND ", "") + "modacad.key1 = thisform.text1.value" ENDIF IF NOT EMPTY(thisform.text2.value) lcWhereCond = IIF( NOT EMPTY(lcWhereCond), " AND ", "") + "modacad.key2 = thisform.text2.value" ENDIF IF NOT EMPTY(thisform.text3.value) lcWhereCond = IIF( NOT EMPTY(lcWhereCond), " AND ", "") + "modacad.key3 = thisform.text3.value" ENDIFBTW, it's bad idea to use hardcoded pathes in your application. It'll be nightmare if you ever have to move data around. You should also open table explicitly with USE command or using DE of the form. After that you can reference the tables by alias.
>WITH main.lstSource > .RowSourcetype = 3 > .Rowsource = 'SELECT mainkey FROM ("U:\Data\modacad.dbf")'+; > 'WHERE thisform.text1.value=modacad.key1 order BY mainkey'+; > 'into cursor result' > .ColumnCount = 1 >ENDWITH >>