>I am looking for better logic to my input statement.
>I have 10 input boxes representing 10 diff fields which the user enters values into as many as he likes to narrow down his search.
>the more textboxes filled out, the more narrow his search becomes.
>Then I must set a filter using my screwy logic unless someone has a good idea for me.
>Thank you !
Timothy,
I did something like this once. Mine were check boxes. Since you said that you could SELECT into a cursor...
The trick is to construct the WHERE clause with an extra "AND" on the front, and then SUBSTR it off. That way you won't have to always be checking to see if you have a condition.
cMySelect = [SELECT * FROM MyTable ]
cMyWhere = ;
IIF(!EMPTY(Field1), [ AND Field1 = ] + EnteredValue1, []) + ;
IIF(!EMPTY(Field2), [ AND Field2 = ] + EnteredValue2, []) + ;
....
IIF(!EMPTY(FieldN), [ AND FieldN = ] + EnteredValueN, [])
cMyOrder = SomeOrder
cMySQLStatement = ;
cMySelect + ;
IIF(!EMPTY(cMyWhere), [WHERE ] + SUBSTR(cMyWhere, 6)) + ;
cMyOrder
&cMySQLStatement
I hope this gives you the idea.