Help and Support

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

Article ID:275087
Last Review:November 18, 2004
Revision:3.1
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.

Back to the top

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.

Back to the top

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.

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

MORE INFORMATION

Steps to Reproduce the Behavior

1.In Access 2000, create a new database, and then save it as Db1.mdb.
2.In the new database, create a new form.
3.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 "You should ALWAYS get this message box."
    Stop
    MsgBox "You should NEVER get this message box."
End Sub
					
4.Close the Visual Basic Editor, and then switch the form to Form view.
5.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.
6.Close the Visual Basic Editor, and then click OK to stop the debugger.
7.Close the form and save it as Form1.
8.Quit Access 2000, and then open Db1.mdb in Access 2002.
9.Open the Form1 form, and then click the command button. Note that you receive the first message box.
10.Click OK in the message. Instead of the code being opened in suspend mode, note that you get the second message box.

Back to the top


APPLIES TO
Microsoft Access 2002 Standard Edition

Back to the top

Keywords: 
kbbug kbnofix KB275087

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.