ACC1x: "Illegal Function Call" Error When Exporting Module

Last reviewed: June 8, 1997
Article ID: Q109951
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

When you run an Access Basic procedure to export a module from one Microsoft Access database to another containing a module of the same name, you receive the error message "Illegal function call."

RESOLUTION

There are two methods for working around this problem:

  • Use a macro with the TransferDatabase action to export the module.
  • Verify that no module in the destination database has the same name as the module you want to export. If necessary, change the name of the module before exporting it.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a copy of the sample database NWIND.MDB. Name the copy DEST.MDB.

  2. Open the NWIND.MDB database.

  3. Create a new module with the following sample code, and then save the module as SourceMod.

    NOTE: In the following sample code, an underscore (_) is used as a line- continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic.

          '*******************************
          ' Declarations section of module
          '*******************************
          Option Explicit
    

          Function ExportSourceMod ()
    
             DoCmd TransferDatabase A_EXPORT, "Microsoft Access", "DEST.MDB",_
                A_MODULE, "SourceMod", "DestMod"
          End Function
    
    

  4. In the module's Immediate window, type the following line, and then press ENTER:

          ? ExportSourceMod ()
    

    The SourceMod module will be exported to the DEST.MDB database.

  5. Repeat step 4. This time, you will receive the error message stated above, because the module already exists in the destination database.

REFERENCES

Microsoft Access "Language Reference," version 1.0, "TransferDatabase Action," pages 473-476

Microsoft Access "User's Guide," version 1.0, pages 525 and 583

Microsoft Access "User's Guide," version 1.1, pages 529 and 587

For more information about the TransferDatabase action, search for "TransferDatabase" using the Microsoft Access Help menu.


Keywords : kberrmsg kbprg PgmOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.