Can't find Function in Macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redman08
    New Member
    • Dec 2008
    • 34

    Can't find Function in Macro

    Here's an annoying one.

    Using Access 2007, I've set up a macro which includes:
    RunCode TRK001MCATSPath wayCases ()

    The function called is a Public Function.

    When running the macro I keep getting an error message:
    "The expression you entered has a function name that Microsoft Office Access can't find."

    I've tried creating the entry manually as well as using the wizard to find the function. In theory, it's found the function (using the wizard), but when running, it says it can't. When executing it manually, it runs ok.

    Any ideas?

    Thanks in advance.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Verify that TRK001MCATSPath wayCases () is the function name and not the module name.

    Comment

    • Krandor
      New Member
      • Aug 2008
      • 50

      #3
      If your function is not in a module, then it doesn't matter if it is public or not, you will only be able to use it in the form that houses it. to be truly pulic, the function has to reside in a module.

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        And as puppydogbuddy has hinted at, if the module name and function name are the same, this type of error will occur.

        Welcome to Bytes!

        Linq ;0)>

        Comment

        • redman08
          New Member
          • Dec 2008
          • 34

          #5
          That last comment by Linq was spot on. The module and function name were the same. All sorted now.

          Many thanks for all input.

          Comment

          Working...