ACC97: Syntax Error (Missing Operator) in Query Expression '()'

Last reviewed: October 20, 1997
Article ID: Q174727
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you use the OpenReport action in a macro and specify a query name to be used as a filter for the report, you may receive the following error message when you run the macro:

   Syntax error (missing operator) in query expression '()'

RESOLUTION

Use the RecordSource property to change the record source of the report to the query.

-or-

Modify the query that is used as a filter for the report. To do so, follow these steps:

  1. Open the query in Design view.

  2. Add the following field to the query grid:

          Field: True
    
             Show: No
             Criteria: <>False
    
    

  3. Save and close the query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Open the sample database Northwind.mdb, and create a new report based on the Products table.

  2. If the Field List is not displayed, on the View menu, click Field List, and drag the ProductID, ProductName, and CategoryID fields to the detail section of the report.

  3. Save the report as MyReport, and then close the report.

  4. Create a new query based on the Products table.

  5. Add the ProductID, ProductName, and the CategoryID fields to the query grid.

  6. In the Sort row, select Ascending for the ProductName column.

  7. Save the query as MyQuery, and then close the query.

  8. Create the following new macro, and then save it as MyMacro:

          Action
          ----------
          OpenReport
    

          Action Arguments
          ---------------------
          Report Name: MyReport
          View: Print Preview
          Filter Name: MyQuery
    

  9. On the Run menu, click Run. Note that you receive the following error message:

          Syntax error (missing operator) in query expression '()'.
    


Additional query words: pra
Keywords : McrProb kberrmsg
Version : 97
Platform : WINDOWS
Hardware : x86
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.