After writing a Sub procedure, you may want to test it. You can run a Sub procedure from within the Visual Basic Editor, but you might have to return to Access to view the results. If the Sub procedure is a long one, you can also click buttons to pause it or to stop it altogether.
Run a Sub Procedure
Click the Save button on the Database toolbar to save changes to the VBA project.
Enter a name for your module if requested.
Click anywhere within the Sub procedure that you want to run.
Click the Run Sub/User Form button on the Database toolbar.If the Macros dialog box appears, select the macro you want to run, and then click Run.
Return to Access, if necessary, to view the results of your Sub procedure.
Did You Know?
You can rename a module. If you want to rename a module, select the module from the Project Explorer, and then enter a new name in the Name box, located in the Properties window.
You can run a procedure from the keyboard. You can also run a Sub procedure by pressing F5. If you need to halt the procedure, press the Ctrl and the Break keys simultaneously.
|