ACC2000: Module Disappears After Running CodeID: Q223199
|
Running code in a module may cause the module to disappear.
When you are running code in a new, unsaved module and the code includes the programmatic creation and saving of another new module, the module that contains the running code disappears.
Because existing (saved) modules are not affected when new modules are created programmatically, ensure that the active module is compiled and saved before you run it.
Unfortunately, there is no way to recover a module that has disappeared because of this issue.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Option Explicit
Sub CreateMod()
Dim myModule as Object
Set myModule = Application.VBE.VBProjects("Northwind"). _
VBComponents.Add(vbext_ct_StdModule)
' The following line causes the module to disappear
DoCmd.Save acModule, myModule.Name
End Sub
Additional query words: pra deleted delete removed remove
Keywords : kbdta PgmObj
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 6, 1999