DOCMD RUN MACRO
Feb 23 2006, 03:36 PM
Joined: 30-September 04
Below is the code that I want to run from a Tab Control Tab. My question is what criteria is expected in the last to areas of the DoCmd after the Marco Name?
DoCmd.RunMacro "03 EVENTS_NO_TIME_MAPPING", ,
Feb 23 2006, 03:39 PM
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>
From the Help files:
The RunMacro method carries out the RunMacro action in Visual Basic. For more information on how the action and its arguments work, see the action topic.
DoCmd.RunMacro macroname[, repeatcount][, repeatexpression]
The RunMacro method has the following arguments.
macroname A string expression that's the valid name of a macro in the current database.
If you run Visual Basic code containing the RunMacro method in a library database, Microsoft Access looks for the macro with this name in the library database and doesn't look for it in the current database.
repeatcount A numeric expression that evaluates to an integer, which is the number of times the macro will run.
repeatexpression A numeric expression that's evaluated each time the macro runs. When it evaluates to False (0), the macro stops running.
You can use macrogroupname.macroname syntax for the macroname argument to run a particular macro in a macro group.
If you specify the repeatexpression argument and leave the repeatcount argument blank, you must include the repeatcount argument's comma. If you leave a trailing argument blank, don't use a comma following the last argument you specify.
If you do not need any of these optional arguments then do not use any commas.
Feb 23 2006, 03:39 PM
Joined: 23-September 04
From: NC, USA
the two OPTIONAL variables are repeat count and repate expression.
You should be able to find something about them in the help file:
repeatcount A numeric expression that evaluates to an integer,
which is the number of times the macro will run.
repeatexpression A numeric expression that's evaluated each time the
macro runs. When it evaluates to False (0), the macro stops running.
Feb 23 2006, 03:45 PM
Joined: 13-January 05
I think I am correct when I say that all of the DoCmd actions can be seen in the Action column of the Macro Window. So the thing I like to do is open that window to a new macro, set the Action field to the action I want to run, then see what the Action Arguments are in the box at the bottom. I have even gone so far as to actually develop a macro, verify that it does what I want it to do, then convert it to a module and edit the code to a more general-purpose action so that I can pass in the name of the form to open, for instance, or whatever else.
Edited by: fkegley on Thu Feb 23 15:46:13 EST 2006.
|Search Top Lo-Fi||9th December 2016 - 08:09 PM|