lcWhere = "" If !empty(thisform.text1.Value) lcWhere = ' WHERE thisform.text1.value=modacad.key1' Endif If !empty(thisform.text2.Value) If !empty(lcWhere) lcWhere = lcWhere + " and " Endif lcWhere = lcWhere + 'WHERE thisform.text2.value=modacad.key2' Endif If !Empty(thisform.text3.value) If !Empty(lcWhere) lcWhere = lcWhere + " and " Endif lcWhere = lcWhere + 'WHERE thisform.text3.value=modacad.key3' endif lcSelect = 'SELECT mainkey FROM ("U:\Data\modacad.dbf")' + lcWhere + ; ' order BY mainkey into cursor result' &lcSelect>Good Morning,
>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 >>