Share via

How to I initialize/enable/activate a module?

Anonymous
2024-06-20T14:36:29+00:00

I'm not sure of the term. But how do I make it so that I can access the code in a vba module?

I'm putting a macro into my back end, and I want to reference a user defined function. I created a module, put the function code in, saved, restarted the database. I cannot reference the function. If I run the macro, there's an error, if I use the expression builder the module and it's function don't show up. I assume there's something I have to do to make the module active or something, but I've no clue what that is.

Microsoft 365 and Office | Access | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

DBG 11,711 Reputation points Volunteer Moderator
2024-06-20T14:41:04+00:00

The function has to be declared as Public and stored in the same file as the macro or included in the VBA references.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. DBG 11,711 Reputation points Volunteer Moderator
    2024-06-20T15:08:59+00:00

    Thank you for your reply. It wound up being my mess up. A typing error I wasn't noticing as I looked things over.

    Glad to hear you got it sorted out. Good luck with your project.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-06-20T14:46:33+00:00

    The function has to be declared as Public and stored in the same file as the macro or included in the VBA references.

    Thank you for your reply. It wound up being my mess up. A typing error I wasn't noticing as I looked things over.

    Was this answer helpful?

    0 comments No comments