All-Record criteria in a query...hmmm

S

Steve P

I'm using a "settings" table to capture text strings to use as criteria for
queries. So, after selecting an option in a combobox, i have a script that
will update the value in my settings table. That same field is linked to a
query I've built and serves as a "dynamic" criteria for the query. If a
"one" is selected, a "1" is written on the table, from which the query uses
the "1" as criteria for in a field.

My question is, what should the table setting be to select all records (ie:
no criteria)? I've been trying "Like '*'" and deviations of it to no avail.

Please help.
 
G

ghetto_banjo

Like "*" works for me, so perhaps the issue lies elsewhere.


when you use Like "*", is it excluding just certain records or what?


one thing i use in a similar situation is the Nz function. i have
user enter a value for criteria, but if he enters nothing (i.e. null)
then the Nz function works like this in my query criteria:

Like Nz(Forms!frmSetup.combo1, "*")
 
K

KARL DEWEY

'Like' stored in a field is a text string instead of a function.
Just store "*" without the quotes.

Use this as criteria -- Like [YourTable].[YourField]
 
S

Steve P

I tried both methods and its still not working.

Ghetto,
If I hardcode: Like "*" into the query criteria through the query
builder, it works no problem. However, I have the query's criteria field
linked to the field (text) on a different table in the database...I can't
seem to get the syntax right for the field value so that it will properly
drive the query.

KARL,
same thing with your solution... :-(


You guys got any other ideas?? Thnx for the attempt...I feel like I'm
almost to the solution.
 
S

Steve P

Ghetto,
I missed that last part of your reply...the Nz trick worked perfectly!
THANKS!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top