Uncle G is right. Here is a more detailed explanation.
A form can "see" a function from two places - its own class module and a general module. (Exceptions exist but they are convoluted!) If you can't see it, you can't call it. It is called "scope" - and by the way, scope applies to functions, subs, and variables.
For your function:
Forms can have one module, called the class module. In the form's class module, ALL variables, subs, and functions are effectively private to the form. You can declare something to be public but it has no effect in that context. By habit, most of us will either not declare an explicit scope or will declare private scope.
If there is a sub-form associated with the form, it is actually a different form that has its own class module. Remember that you declare the sub-form separately and THEN associate it with the parent form through a sub-form control.
In a general module, things can be public, private, or declared with no explicit scope. By default, items are private to the general module, meaning that they can still be used by other elements from within the general module. However, if you declare items public from that general module, they become usable anywhere within the project.