Calling Function from modules ?

Hi, I have a function in module: "Public Function GetCity(OrderNo As Str) As String". But when I tried to call it from an event procedure from a form, it says "Compile error: User-defined type not defined".
I suppose I have to do function declaration somewhere ? I don't have User-defined type as I use the regular types for my variables.

Comments

  • : Hi, I have a function in module: "Public Function GetCity(OrderNo As Str) As String". But when I tried to call it from an event procedure from a form, it says "Compile error: User-defined type not defined".
    : I suppose I have to do function declaration somewhere ? I don't have User-defined type as I use the regular types for my variables.
    :

    Modules are global- all forms, modules, reports, and queries can "see" a function/sub in a module as long as it is declared as Public.
    The reverse is not true, if your function is declared in a form or report, it is local to that object alone.

    In the visual basic editor, have you tried to debug/compile to compile all the source code?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion