ACC: Echo Action Without Any Argument Causes Error

Last reviewed: May 28, 1997
Article ID: Q101126
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS

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

In Microsoft Access 7.0 and 97, if you leave the Echo On argument out of the Echo action in a module, you may receive the error message, "Argument Not Optional."

In Microsoft Access Versions 1.x and 2.0, if you leave the Echo On argument out of the Echo action in a module, you may receive the error message, "Expected: Expression."

RESOLUTION

Although the Microsoft Access Help system states that the default argument for the Echo action is Yes, you must include the argument in the line of code in order for the action to run properly.

MORE INFORMATION

Steps to Reproduce Behavior

In Microsoft Access 7.0 and 97:

  1. Open the sample database Northwind.mdb.

  2. Create a new module.

  3. Enter the following code in the Module window:

         '---------------------------------------------------------------
         ' The following function will produce the syntax error mentioned
         ' in the "Symptoms" section.
         '---------------------------------------------------------------
    
            Function Test()
               Docmd.Echo         ' Note that the arguments are missing.
            End Function
    
    

  4. On the Run menu, click Compile Loaded Modules.

In Microsoft Access versions 1.x and 2.0:

  1. Open the sample database NWIND.MDB.

  2. Create a new module.

  3. Enter the following code in the Module window:

          '--------------------------------------------------------------
          'The following function will produce the syntax error mentioned
          'in the "Symptoms" section.
          '--------------------------------------------------------------
          Function Test()
    
             Docmd Echo         ' Note that the arguments are missing.
          End Function
    
    

REFERENCES

For more information about the Echo action, search the Help Index for "Echo," and then "Echo Action," or ask the Microsoft Access 97 Office Assistant.


Keywords : kbusage McrArg
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution 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: May 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.