UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> DOCMD RUN MACRO    
 
   
aldeb
post Feb 23 2006, 03:36 PM
Post #1

UtterAccess Guru
Posts: 920
From: Kentucky



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?
CODE
DoCmd.RunMacro "03 EVENTS_NO_TIME_MAPPING", ,
Go to the top of the page
 
+
niesz
post Feb 23 2006, 03:39 PM
Post #2

Utter A-fishin'-ado
Posts: 17,957
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.
Syntax
DoCmd.RunMacro macroname[, repeatcount][, repeatexpression]
The RunMacro method has the following arguments.
Argument Description
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.
Remarks
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.
Go to the top of the page
 
+
freakazeud
post Feb 23 2006, 03:39 PM
Post #3

UtterAccess VIP
Posts: 31,413
From: NC, USA



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

HTH
Good luck
Go to the top of the page
 
+
fkegley
post Feb 23 2006, 03:45 PM
Post #4

UtterAccess VIP
Posts: 23,630
From: Mississippi



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.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 20th October 2014 - 04:38 AM