I don’t normally use macros, but here is one you may find useful.
The AutoExec macro.
If you call the macro “AutoExec”, it will run whenever someone opens the database.
Pretty nice huh?
So in this example, I want the “VBAInputBoxCancel” (Function) to run whenever I open the database.
If you recall, I used this as a sub procedure back in this post, but as a “sub procedure”.
Normally a function returns a value, and a sub procedure does something, but this could do either, so I just called it a sub.
Anyway, all that needed to be done, is change the “sub procedure” into a “function”, and Access was able to identify it.
So now, whenever the database is loaded the “VBAInputBoxCancel” function runs.
Let me know if you have any questions.