I’m on a role. Another weird occurrence in Access. I’m attempting to use a form field as the source for a query filter criteria. Everything works fine if I simply use an “if equal” filter condition. As soon as I try a “like” condition, nothing works.
I created a test table with just one column (fld1). The table contains three records with the following values: BRDODS, BRD, TLAODS.
The following “hard coded” query returns two records, as it should.
SELECT Table1.fld1
FROM Table1
WHERE (((Table1.fld1) Like 'BRD*'));
I also created a test form (Form1) with just one text field (Text0). My intent is to soft code a criteria value via the form field instead of hard coding the query, as above. When I populate the form field with BRDODS, the following “soft coded” query returns one record, as it should.
SELECT Table1.fld1
FROM Table1
WHERE (((Table1.fld1)=[Forms]![Form1]![Text0]));
When I enter LIKE ‘BRD*’ in the form field, no records are returned. I should get two records, just like the hard coded query above.
I’ve tried all variations of the LIKE statement in the form field, but nothing works.
Help!
I created a test table with just one column (fld1). The table contains three records with the following values: BRDODS, BRD, TLAODS.
The following “hard coded” query returns two records, as it should.
SELECT Table1.fld1
FROM Table1
WHERE (((Table1.fld1) Like 'BRD*'));
I also created a test form (Form1) with just one text field (Text0). My intent is to soft code a criteria value via the form field instead of hard coding the query, as above. When I populate the form field with BRDODS, the following “soft coded” query returns one record, as it should.
SELECT Table1.fld1
FROM Table1
WHERE (((Table1.fld1)=[Forms]![Form1]![Text0]));
When I enter LIKE ‘BRD*’ in the form field, no records are returned. I should get two records, just like the hard coded query above.
I’ve tried all variations of the LIKE statement in the form field, but nothing works.
Help!