Results 1 to 9 of 9

running a module from a macro - error can't find function name

  1. #1
    LenO is offline Novice
    Windows 2K Access 2007
    Join Date
    Jun 2013
    Posts
    5

    running a module from a macro - error can't find function name

    I am relatively new to modules however, i have created one now i want to set an autoexec macro to kick off the module. the module name is ModBillingDocRpt and the name i have given it in the module itself is BillingDocRpt() When i set this under run command in my macro it gives me an error that microsoft can not find function name.
    This is what i used in the macro ModBillingDocRpt() it didnt work then i tried BillingDocRpt() and same error message. What am i doing wrong?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,205
    You would use the name of the function, not the name of the module. Make sure it's a public function, not a sub. You're using the RunCode action?
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  3. #3
    LenO is offline Novice
    Windows 2K Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    You would use the name of the function, not the name of the module. Make sure it's a public function, not a sub. You're using the RunCode action?
    yes, sorry, it is RunCode - how do i tell if it is public or not?

  4. #4
    LenO is offline Novice
    Windows 2K Access 2007
    Join Date
    Jun 2013
    Posts
    5
    The name of my function is BillingDocRpt() and it still can not find it.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,205
    Can you post the db here?
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  6. #6
    LenO is offline Novice
    Windows 2K Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    Can you post the db here?
    I can't get it loaded - it might be our systems not allowing me to do this. We have very tight controls on things like this. i can send you the code inside this, it is not a very large code

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,205
    That might be enough.
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  8. #8
    LenO is offline Novice
    Windows 2K Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by pbaldy View Post
    Can you post the db here?
    I figured it out. Thank you for pointing me in the direction... cruzin now...

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,205
    No problem.
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Running Code from a Module in a Macro
    By ReadyReckoners in forum Modules
    Replies: 2
    Last Post: 05-08-2013, 03:45 AM
  2. Access AutoExec Macro Cannot Find Function
    By JuanTooTree in forum Access
    Replies: 3
    Last Post: 03-14-2013, 07:52 AM
  3. Module Error in Macro
    By TimMoffy in forum Modules
    Replies: 3
    Last Post: 06-20-2012, 08:52 AM
  4. Running module from Macro
    By Harley Guy in forum Modules
    Replies: 6
    Last Post: 10-27-2010, 10:05 AM
  5. Running a VB function in a Macro
    By JuuJuu in forum Access
    Replies: 1
    Last Post: 10-27-2009, 01:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums