Question

I have multiple MS-Access 2003 project with some VBA code and there are some redundant functions that I would like to have in the same file. I thought about saving it in an external .bas module and loading it into all my projects. Is it possible? If so, how can we implement this and will I have to change the actual (simple) calls to my functions?

Was it helpful?

Solution

You can use the undocumented:

Application.SaveAsText acModule, "module1", "module1x.bas"
Application.LoadFromText acModule, "module1y", "module1x.bas"

Or you can simply save and load manually with right-click on the module name in the code window.

Finally, you can reference an Access application in the same way as any other reference, and then use the code. The file type *.mda was the library type. As far as I know, from 2007, you can create an *.accda library type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top