Microsoft KB Archive/174727

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

Article ID: 174727

Article Last Modified on 1/20/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q174727



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



SYMPTOMS
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:  Open the query in Design view.  Add the following field to the query grid:   Field: True Show: No     Criteria: <>False  Save and close the query.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 97.



Steps to Reproduce Problem
 Open the sample database Northwind.mdb, and create a new report based on the Products table.</li> 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.</li> Save the report as MyReport, and then close the report.</li> Create a new query based on the Products table.</li> Add the ProductID, ProductName, and the CategoryID fields to the query grid.</li> In the Sort row, select Ascending for the ProductName column.</li> Save the query as MyQuery, and then close the query.</li>  Create the following new macro, and then save it as MyMacro: <pre class="fixed_text">  Action --  OpenReport

Action Arguments -  Report Name: MyReport View: Print Preview Filter Name: MyQuery </li> On the Run menu, click Run. Note that you receive the following error message:

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

</li></ol>

Additional query words: pra

Keywords: kbbug kberrmsg KB174727

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.