ACC97: New Module in Microsoft Access 97 Not Saved If EmptyLast reviewed: October 16, 1997Article ID: Q175218 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you create a module in Microsoft Access 97, you are not prompted to save the module if you have not entered data into the module. In Microsoft Access 95, you are prompted to save the module even though the module is empty. This behavior occurs in Microsoft Access 97 regardless of whether you are creating the module with code or you are creating the module manually.
CAUSEThe module must contain data before it can be saved.
RESOLUTIONWhen you want to create a module that will not have any code, add a procedure or function to the module before you save it. This will ensure that the module is saved. For example, the following procedure will create a new module, add a procedure to the module, and then save the module.
Sub CreateNewModule() Dim MyMod As Module Dim MyStr As String DoCmd.RunCommand acCmdNewObjectModule ' Create new module. MyStr = "Sub Test2()" & vbCrLf ' Create text for the module. MyStr = MyStr & Space$(4) & "MsgBox " & Chr$(34) & "test2" & _ Chr$(34) & vbCrLf MyStr = MyStr & "End Sub" Set MyMod = Modules("Module3") ' Give module a name. MyMod.InsertText MyStr ' Insert text into the module. DoCmd.Close acModule, "Module3", acSaveYes ' Close and save module. End Sub STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about creating modules, search the Help Index for "modules, overview," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: not dirty
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |