If your Function(s) are accessed only by a particular Form, and not by any other Form(s), I would keep it ‘local’ in this Form as Private Function(s). But if you have Function(s) that are accessed from multiple Forms, I would place them in one location as Public Function(s) in a Module.
Functions that are not unique to the form should be in a separate module. Most functions I write tend not to be unique. If it is truly form specific then it should stay in the form.
If the function is only for use with the form, then put it on the form. (If you import the form somewhere else you have fewer supporting objects to worry about).
If it is generic and could apply to multiple things, put it in a regular module. (If you use the function somewhere else, deleting the form won't break something else).
Generally though if you are bothering to take the time to break it out, it probabably falls in the second scenario.
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.