Microsoft KB Archive/275087

= The Stop statement in an Access 2000 database does not work in Access 2002 =

Article ID: 275087

Article Last Modified on 11/18/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q275087



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
The Stop statement, which suspends the Visual Basic for Applications (VBA) code in a Microsoft Access 2000 database, no longer works when you use the same database in Access 2002.



CAUSE
Access 2002 cannot go into break mode with code that has been compiled in Access 2000. A Stop statement is ignored, just as the same statement would be ignored in an Access *.mde file.



RESOLUTION
If you open the Visual Basic Editor in Access 2002, the code will be decompiled, allowing the Stop statement to resume its functionality as it did in Access 2000 (that is, suspend code execution). Therefore, open and close the Visual Basic Editor in Access 2002 before running the code.



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
 In Access 2000, create a new database, and then save it as Db1.mdb. In the new database, create a new form.  Add a command button to the form, and then assign the following VBA code to the Click event of this button: Private Sub Command0_Click MsgBox &quot;You should ALWAYS get this message box.&quot; Stop MsgBox &quot;You should NEVER get this message box.&quot; End Sub  Close the Visual Basic Editor, and then switch the form to Form view. Click the command button, and then click OK in the message box. You should now be back in the Visual Basic Editor, and the Stop statement should be highlighted.</li> Close the Visual Basic Editor, and then click OK to stop the debugger.</li> Close the form and save it as Form1.</li> Quit Access 2000, and then open Db1.mdb in Access 2002.</li> Open the Form1 form, and then click the command button. Note that you receive the first message box.</li> Click OK in the message. Instead of the code being opened in suspend mode, note that you get the second message box.</li></ol>

Additional query words: pra doesn't work doesn t

Keywords: kbbug kbnofix KB275087

-

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

© Microsoft Corporation. All rights reserved.