calling modules syntax

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a module and a function within that module. But I can't find
the syntax to call my procedure from a query.

Basically all i want is to be able to compare two numbers (contained in two
different fields) and return the larger one,so i wrote a VB function to do it
but now i don't know how to call it
 
I assume that the function accept to parameters, and return a value
Function FunctionName(Param1 as .., Param2 as ..)
Youcode
FunctionName = Value
End Function

IN the SQL it will look as follow

Select Field1, Field2 , FunctionName([Field1], [Field2]) as ValueReturned
From TableName
 
That is the syntax i am currently using, but I actually JUSTTT found out my
problem. I had declared my functions to be private, once i changed that to
public everything worked fine. I don't understand why private caused this
confusion as it is prefered in Java but nonetheless....

Ofer said:
I assume that the function accept to parameters, and return a value
Function FunctionName(Param1 as .., Param2 as ..)
Youcode
FunctionName = Value
End Function

IN the SQL it will look as follow

Select Field1, Field2 , FunctionName([Field1], [Field2]) as ValueReturned
From TableName


imad hammad said:
I have created a module and a function within that module. But I can't find
the syntax to call my procedure from a query.

Basically all i want is to be able to compare two numbers (contained in two
different fields) and return the larger one,so i wrote a VB function to do it
but now i don't know how to call it
 
Back
Top