help with DoCmd.RunMacro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 7 of 9
    New Member
    • May 2007
    • 23

    #1

    help with DoCmd.RunMacro

    I am creating a Module in access to export the results of a query to excel and once there run a macro that i have created. the problem is that this is the first time that I have done this and I am not sure how.

    when I begin to write the code access tellls me to put it in the following format:

    DoCmd.RunMacro (MacroName,[RepeatCount],[RepeatExpressio n])


    but when i do ittells me,

    compile error expected =

    what is the correct syntax

    Thanks
    Last edited by 7 of 9; Jul 12 '07, 03:09 PM. Reason: got half of the answer somewhere else
  • JConsulting
    Recognized Expert Contributor
    • Apr 2007
    • 603

    #2
    Originally posted by 7 of 9
    I am creating a Module in access to export the results of a query to excel and once there run a macro that i have created. the problem is that this is the first time that I have done this and I am not sure how.

    when I begin to write the code access tellls me to put it in the following format:

    DoCmd.RunMacro (MacroName,[RepeatCount],[RepeatExpressio n])


    but when i do ittells me,

    compile error expected =

    what is the correct syntax

    Thanks
    IT can be a bit confusing, especially without examples.
    Code:
    doCmd.runMacro "yourmacroname"
    that's all you need. The repeat count applies if you want to run the macro more than once and the repeat expression is an option that lets you run just one expression in your macro multiple times. You don't have to include those to run your macro.
    J

    Comment

    • 7 of 9
      New Member
      • May 2007
      • 23

      #3
      Originally posted by JConsulting
      IT can be a bit confusing, especially without examples.
      Code:
      doCmd.runMacro "yourmacroname"
      that's all you need. The repeat count applies if you want to run the macro more than once and the repeat expression is an option that lets you run just one expression in your macro multiple times. You don't have to include those to run your macro.
      J
      It workes! -Thanks J.

      Comment

      Working...