Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: You Cannot Open a Form Module, and the Form's Code Does Not Run


View products that this article applies to.

This article was previously published under Q265434
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

↑ Back to the top


Symptoms

When you are working with a form in Design view, you notice the following behavior:
  • You cannot open the module of the form by any of the standard methods, including clicking Code on the View menu, clicking the View Code button on the toolbar, or clicking the Build button on the Event tab of the property sheet.
  • You are prompted to save changes when you close the form, but the form does not close, and your changes are not saved.
  • Form objects that run code, such as command buttons, no longer work.

↑ Back to the top


Cause

The module of the form has been removed or deleted, but the HasModule property of the form is still set to Yes.

↑ Back to the top


Resolution

After the module of a form is removed or deleted, the code is lost. To continue to work with this form, you must rewrite the code. To do this, set the HasModule property of the form to No, and then save the form. After you have saved the form, re-create the module of the form by either setting the HasModule property to Yes or by using one of the standard methods to open the module of the form.

To set the HasModule property

  1. Open the form in Design view.
  2. If the property sheet is not displayed, click Properties on the View menu.
  3. In the property sheet, click the Other tab.
  4. Set the HasModule property to No.
  5. Close and save the form.
  6. Reopen the form and reset the HasModule property to Yes.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


Keywords: KB265434, kbnofix, kbbug

↑ Back to the top

Article Info
Article ID : 265434
Revision : 2
Created on : 6/25/2004
Published on : 6/25/2004
Exists online : False
Views : 263