1

In Access I created a Function within a Module.

I need to execute this module when the Access application first opens.

In the AutoExec macro, I added the action [RunCode] and wrote the name of the function from this module in [Function Name] but when I run the application I am getting the following error: access error msg

2
  • Make sure that you include the parentheses after the function name in the RunCode step, e.g., DsnLessLinkTable(). Commented Apr 14, 2015 at 11:07
  • thanks @GordThompson for the reply, it worked for both parentheses () and double quotes " ", which one i can consider correct?
    – Noora No
    Commented Apr 14, 2015 at 12:22

1 Answer 1

1

If you're using a function, you should always include a set of parenthesis at the end:

DsnLessLinkTable()

This is the proper way to reference a function, and becomes important if you are ever passing variables to a function, so it's good practice to always use that syntax.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.