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

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: =
-or-
Expected: expression
-or-
Expected: )


RESOLUTION

In the Debug Window, type a question mark before the function name when you run a function that returns a value.


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.


  2. In Microsoft Access 7.0 or 97, press CTRL+G to open the Debug Window. 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.


  5. In Microsoft Access 97
    Compile error:
    Expected: =
    In Microsoft Access 7.0
    Expected: expression
    In Microsoft Access 2.0
    Expected: statement
  6. Type Left("This",2) in the Debug window and press ENTER. Note that you receive the following error message:


  7. In Microsoft Access 97
    Compile error:
    Expected: =
    In Microsoft Access 7.0
    Expected: )
    In Microsoft Access 2.0
    Expected: statement
  8. Repeat steps 3 through 5, but type a question mark at the beginning of each function. Note that you receive results instead of error messages.


Additional query words:

Keywords : kberrmsg kbprg AccCon
Version : WINDOWS:2.0,7.0,97
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: October 21, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.