calling modules syntax

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top