
Syntax for creating a function
Try this (untested aircode):
' ===== BEGIN FUNCTION =====
Public Function fnStandDev(iNumOne as Integer, iNumTwo as
Integer)
fnStandDev = 'Do Something with iNumOne and iNumTwo
(Put your calculation here)
End Function
' ===== END FUNCTION =====
In a QBE grid you would put:
MyStandDev:fnStandDev(NumFieldOne, NumFieldTwo)
Not being a mathmatician, I may be way off.....
--
HTH
Tim Hansen
========================
Quote:
>-----Original Message-----
>Hi there,
>I want to create a function in a modules to calculate the
>average of each difference of some records in number.
Then
>I can use this function in query. It's like a formula of
>the standard deviation. So I used the For Loop in the
>modules. But I don't know the syntax for the number of
>record. I also don't know how to call the name in the
>modules? Or would you give me an example if I want to
>create a function of the standard deviation by myself?
>Thanks,
>Florence
>.