Should probably post the function and the call and be specific about which code is on what. I take this to mean that OP is trying to run code in a form module by calling it from a standard module. While you call some form events and procedures from within the same form, I'm pretty sure the scope of that code isn't available from outside the form. Same goes for a report. If this is what's going on, it's not an error at all (at least on the part of Access).
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.