ACC1x: "Illegal Function Call" Error When Exporting Module

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
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: April 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.