I have a growing Access application that contains a lot of forms & subforms with repetitive code - e.g. buttons to move between records.
What I would like to do is make global subroutines for these common event procedures, and have the various buttons etc just call the global sub instead of the event procedure.
I've tried to do this, by creating a new global module, copying one of the private event procedures into it, changing the name & changing "Private" to "Public".
However when I go back to my form, I'm not able to access this function. My new subroutine name doesn't appear in the event property drop-down list, and if I put "=MySubName()" in the button onclick event property manually, I get an error, usually something like "The expression On Click you entered as the event property setting produced the following error: The expression you entered has a function name that MyApp can't find."
Am I going about things the right way, and if so, how do I reference a subroutine in a global module?
If I'm not doing this correctly, any pointers to the method I should be using to combine all these event procedures (if I can) would be great. (The db is currently over 10mb with virtually no data in it..)
Thanks heaps for any help,
Nicola
What I would like to do is make global subroutines for these common event procedures, and have the various buttons etc just call the global sub instead of the event procedure.
I've tried to do this, by creating a new global module, copying one of the private event procedures into it, changing the name & changing "Private" to "Public".
However when I go back to my form, I'm not able to access this function. My new subroutine name doesn't appear in the event property drop-down list, and if I put "=MySubName()" in the button onclick event property manually, I get an error, usually something like "The expression On Click you entered as the event property setting produced the following error: The expression you entered has a function name that MyApp can't find."
Am I going about things the right way, and if so, how do I reference a subroutine in a global module?
If I'm not doing this correctly, any pointers to the method I should be using to combine all these event procedures (if I can) would be great. (The db is currently over 10mb with virtually no data in it..)
Thanks heaps for any help,
Nicola