STOPPING PROGRAM EXECUTION

Bringing up the Immediate window during runtime is no problem. You can try to pause an application programmatically with either a Stop statement or a breakpoint. When placed in code, both methods will halt the execution of a piece of code and bring up the module editor, with the code line containing the Stop statement or breakpoint highlighted. You can have as many breakpoints and Stop statements in your code as you want.

Figure A.6 shows a Stop statement and a breakpoint set in the ap_AppInit() function, which is in the GlobalUtilities module.

Figure A.6. Breakpoints and Stop statements are two ways to stop execution at a specific point in code.

Note

You can't place Stop statements or breakpoints in comments, variable ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.