ACC: "Expected: =" Error When ? Is Missing in Debug Window

Last reviewed: August 29, 1997
Article ID: Q162463
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

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

When you use the Debug window (or the Immediate window in version 2.0) to run a built-in or user-defined function that returns a value, if you omit a question mark (?) at the beginning of the line, you may receive one of the following messages:

   Expected: =

   Expected: expression

   Expected: )

RESOLUTION

Type a question mark before the function name when you run a function that returns a value in the Debug Window.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. Open the Debug Window by pressing CTRL+G in Microsoft Access 7.0 or 97. In Microsoft Access 2.0, open the Utility Functions module in Design view, and then click Immediate Window on the View menu.

  3. Type Date() in the Debug window and press ENTER. Note that you receive the following error message.

    In Microsoft Access 97:

          Compile error:
          Expected: =
    

    In Microsoft Access 2.0 and 7.0:

          Expected: =
    

  4. Type Now() in the Debug window and press ENTER. Note that you receive the following error message.

    In Microsoft Access 97:

          Compile error:
          Expected: =
    

    In Microsoft Access 7.0:

          Expected: expression
    

    In Microsoft Access 2.0:

          Expected: statement
    

  5. Type Left("This",2) in the Debug window and press ENTER. Note that you receive the following error message:

    In Microsoft Access 97:

          Compile error:
          Expected: =
    

    In Microsoft Access 7.0:

          Expected: )
    

    In Microsoft Access 2.0:

          Expected: statement
    

  6. Repeat steps 3-5, but type a question mark at the beginning of each function. Note that you receive results instead of error messages.
Keywords          : kberrmsg kbprg SynGnrl
Version           : 2.0 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb
Solution Type     : Info_Provided


================================================================================


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: August 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.