Microsoft KB Archive/295268

= Access 2002 quits after you use Access 2000 to recompile code =

Article ID: 295268

Article Last Modified on 11/19/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



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.



Steps to Reproduce the Behavior
 Open the sample database Northwind.mdb. Create a new form that is based on the Orders table.  Add the following code to Undo event of the form: Private Sub Form_Undo(Cancel As Integer) Dim intMsg As Integer intMsg = MsgBox(&quot;Are you sure you want to undo this record?&quot;, vbYesNo) Cancel = Not (intMsg = vbYes) End Sub  Open the form in Form view. Edit a record, and then undo the changes to the record. Note that you receive the message box for the Undo event. Click Yes.</li> Save the changes to the form, and then close the database.</li> Open the sample database Northwind.mdb in Access 2000.</li>  Add following line of code to the Declarations section of the module of the form: Dim MyVar As String </li> On the Debug menu, click Compile .</li> Save and then close the form.</li> Reopen the database in Access 2002.</li> Open the form, edit a record, and then undo the changes to the record.</li></ol>

Note that you experience the behavior that is described in the &quot;Symptoms&quot; section of this article.

Additional query words: pra

Keywords: kberrmsg kbbug KB295268

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.