Results 1 to 9 of 9
  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
    22,518
    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 2007-2019
    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
    22,518
    Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    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
    22,518
    That might be enough.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    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
    22,518
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Access AutoExec Macro Cannot Find Function
    By JuanTooTree in forum Access
    Replies: 10
    Last Post: 06-08-2023, 10:10 AM
  2. Running Code from a Module in a Macro
    By ReadyReckoners in forum Modules
    Replies: 2
    Last Post: 05-08-2013, 04:45 AM
  3. Module Error in Macro
    By TimMoffy in forum Modules
    Replies: 3
    Last Post: 06-20-2012, 09:52 AM
  4. Running module from Macro
    By Harley Guy in forum Modules
    Replies: 6
    Last Post: 10-27-2010, 11:05 AM
  5. Running a VB function in a Macro
    By JuuJuu in forum Access
    Replies: 1
    Last Post: 10-27-2009, 02: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
  •  
Other Forums: Microsoft Office Forums