Search code examples
formsms-accessvbastartup

Access VBA: AutoExec macro can't find function?


I'm trying to execute a function that opens forms at startup and I created the AutoExec macro.

I have a module called startup in which there is a function called startup.

The AutoExec macro has the action Run Code with a function named startup ().

When I start my database, I get the error, "The expression you entered has a function that Access can't find".

Is there something I'm doing wrong? Please help!

Thanks.


Solution

  • You can't have the function name the same as the module name. Change the function name from startup() to onStart().