'rem' ing a criteria in query

  • Thread starter Thread starter alecgreen
  • Start date Start date
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
 
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
 
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"
 
Back
Top