Microsoft KB Archive/162463

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

Article ID: 162463

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q162463



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



SYMPTOMS
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.



Steps to Reproduce Behavior
 Open the sample database Northwind.mdb. 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. 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: =

 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

 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

</li> 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.</li></ol>

Keywords: kberrmsg kbprb kbprogramming KB162463

-

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

© Microsoft Corporation. All rights reserved.