Access 2002 quits after you use Access 2000 to recompile code (295268)



The information in this article applies to:

  • Microsoft Access 2002

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

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

SYMPTOMS

If you add code to one of the new events in Access 2002, and you then compile the database in Access 2000, when the code is run in Access 2002, you may receive the following error, and then Microsoft Access quits:
Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience.
If you click Repair my open database and restart Microsoft Access, the problem persists.

RESOLUTION

You can add or edit code in Access 2000, but you should not compile the database in Access 2000. Instead, open the database in Access 2002, and then compile it there.

STATUS

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

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. Create a new form that is based on the Orders table.
  3. Add the following code to Undo event of the form:
    Private Sub Form_Undo(Cancel As Integer)
       Dim intMsg As Integer
       intMsg = MsgBox("Are you sure you want to undo this record?", vbYesNo)
       Cancel = Not (intMsg = vbYes)
    End Sub
    					
  4. Open the form in Form view.
  5. Edit a record, and then undo the changes to the record. Note that you receive the message box for the Undo event. Click Yes.
  6. Save the changes to the form, and then close the database.
  7. Open the sample database Northwind.mdb in Access 2000.
  8. Add following line of code to the Declarations section of the module of the form:
    Dim MyVar As String
    					
  9. On the Debug menu, click Compile <database name>.
  10. Save and then close the form.
  11. Reopen the database in Access 2002.
  12. Open the form, edit a record, and then undo the changes to the record.
Note that you experience the behavior that is described in the "Symptoms" section of this article.

Modification Type:MinorLast Reviewed:11/19/2004
Keywords:kbbug kberrmsg KB295268