Microsoft KB Archive/209499

= ACC2000: Echo Action Without Any Argument Causes Error =

Article ID: 209499

Article Last Modified on 6/30/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209499



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

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
In Microsoft Access 2000, if you leave the Echo On argument out of the Echo action in a module, you may receive the following error message:

Argument Not Optional.



RESOLUTION
In earlier versions of Microsoft Access, although the Access Help system stated that the default argument for the Echo action was Yes, you had to include the argument in the line of code in order for the action to run properly. With Access 2000, the Echo method of the DoCmd object has no default argument; the argument must be included.

The Echo method of the DoCmd object was added to provide backward compatibility for running the Echo action in Visual Basic code in Microsoft Access for Windows 95. It's recommended that you use the existing Echo method of the Application object instead.



Steps to Reproduce Behavior
 Open the sample database Northwind.mdb.  Create a module and type the following line in the Declarations section: Option Explicit   Type the following procedure: '--- ' 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  On the Debug menu, click Compile Northwind.

