'rem' ing a criteria in query

A

alecgreen

Hi

Just wondered if its possible to REM out a criteria in the query
design grid? so basically the crieria still there but not actioned.

Thanks

Alec
 
A

Allen Browne

alecgreen said:
Just wondered if its possible to REM out a criteria in the query
design grid? so basically the crieria still there but not actioned.

No: the query design grid does not have that power.

Some alternatives:

1. Copy the query in the Database Window (or Navigation Pane in A2007), and
paste. Remove the criteria from this copy of the query.

2. Omit the criteria from the query. Instead, apply a Filter to the report
or form, or whatever the query is for.

3. Use VBA code to programmatically create the query string, and patch the
criteria in. Example

Const strcStub = "SELECT Table1.* FROM Table1 "
Const strcTail = " ORDER BY SomeField;"
Dim strWhere as String
strWhere = " WHERE SomeField = 99 "
CurrentDb.QueryDefs("Query1").SQL = strcStub & strWhere & strcTail
 
B

Bob Barrows

alecgreen said:
Hi

Just wondered if its possible to REM out a criteria in the query
design grid? so basically the crieria still there but not actioned.
The best you can do is enter "1=1" in the grid cell below it, so the sql
becomes "... where field=something or 1=1"
 

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