ACC2000: Echo Action Without Any Argument Causes Error (209499)



The information in this article applies to:

  • Microsoft Access 2000

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.
  2. Create a module and type the following line in the Declarations section:
    Option Explicit
    					
  3. 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
    					
  4. On the Debug menu, click Compile Northwind.

REFERENCES

For more information about the Echo action, click Microsoft Access Help on the Help menu, type Echo in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:6/30/2004
Keywords:kberrmsg kbprb KB209499