You can make it a Public procedure, if you're doing that then you may as well put the procedure in a module which allows easy access.
Hope this helps
HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
I agree, common code should go in a standard module. You can pass the code either a reference to the calling form or just the name of the calling form.
public sub commonRoutine(strFormName as string)
dim frmForm as access.form
frmForm = forms(strFormName)
.....
or simply
public sub commonRoutine(frmForm as access.form)
.....
call commonRoutine(me.name)
or
call commonRoutine(me)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.