Textbox to filter records

alex

Registered User.
Local time
Today, 08:56
Joined
Apr 14, 2009
Messages
13
Hi,

I want to query one of my table based on a textbox in a form: if the user enters nothing in it, I want to return all records; if he enters something, I want to filter the records using his value.

The filter is applied on a numeric column. How can I do that in a query? I'm presently using a LIKE clause, which is probably not the best solution since the column is numeric..:

SELECT * FROM myTable WHERE [id] LIKE IIF([txtId]="", "*", [txtId])

And my query doesn't return records with empty [id] because of the "*" filter..

Thanks!
 
Works like a charm! Thanks!
 

Users who are viewing this thread

Back
Top Bottom