Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Access
Search
Search
 
Icon: Flag: (c) Microsoft
Get up to speed
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Troubleshoot macros
 

ShowI'm using the SendKeys action in a macro to send keystrokes to a dialog box, but they're not being sent.

Because the dialog box suspends the macro, you must put the SendKeys action before the action that causes the dialog box to open and set the Wait argument to No to avoid pauses in processing.

ShowI want to temporarily disable an action in my macro.

This is similar to temporarily turning a line into a comment in Microsoft Visual Basic for Applications (Visual Basic for Applications (VBA): A macro-language version of Microsoft Visual Basic that is used to program Windows applications and is included with several Microsoft applications.) code by typing a single quotation mark (') at the beginning of the line.

  • To cause Access to temporarily ignore an action, type False as a condition in the Condition column.

ShowThe Where Condition argument in my macro's OpenForm or OpenReport action is producing unexpected results.

The Where Condition argument of an OpenForm or OpenReport action might produce unexpected results for any of the following reasons:

ShowThe RunCode action in my macro won't run a Microsoft Visual Basic module.

You use the RunCode action to run a Function procedure, not a module (module: A collection of declarations, statements, and procedures stored together as one named unit. There are two types of modules: standard modules and class modules.). In Microsoft Access, you run procedures rather than modules. Replace the name of the module with the name of the function in the module that you want to run. To run a Sub procedure (Sub procedure: A procedure that carries out an operation. Unlike a Function procedure, a Sub procedure doesn't return a value. You begin a Sub procedure with a Sub statement and end it with an End Sub statement.), call it in the function.

To open a module, use the OpenModule action.

ShowWhen I run my macro, Access displays messages that I don't want to see.

You can hide warnings and other messages while a macro is running by carrying out the SetWarnings action in the macro. You can also use the SetWarnings action to display messages again.

advertisement