Troubleshoot macros

Microsoft Office Access 2003

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 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:

  • The Where Condition expression uses invalid syntax to refer to the value of a control or property.
  • The Where Condition argument uses invalid syntax to combine the value of a field, control, or property with a literal string.
  • The OpenForm or OpenReport action is being carried out by using the corresponding Microsoft Visual Basic for Applications methods in a procedure, and the Where Condition argument is specified in the wrong position in the list of arguments. If the Where Condition argument isn't preceded by View and Filter Name arguments, you must still type a comma as a placeholder for each of these arguments.

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. 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, 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.