A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

'rem' ing a criteria in query



 
 
Thread Tools Display Modes
  #1  
Old March 26th, 2009, 11:04 AM posted to microsoft.public.access.queries
alecgreen
external usenet poster
 
Posts: 45
Default 'rem' ing a criteria in query

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
  #2  
Old March 26th, 2009, 11:52 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default 'rem' ing a criteria in query

"alecgreen" wrote in message
...
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

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

  #3  
Old March 26th, 2009, 02:40 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default 'rem' ing a criteria in query

alecgreen wrote:
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"

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.