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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
'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
|
|||
|
|||
'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
|
|||
|
|||
'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 | |
|
|