How to write this as a function in the modules

  • Thread starter Thread starter fl
  • Start date Start date
F

fl

How do I write the following as a function in the Modules so that I can
use it repeatedly in a query? Thanks.

Bonus: IIf(([variable1] Is Null Or [variable1]<3),'-
-',(IIf(([varialbe1]>=3 And [variable2] Is Null),'0',[variale2])))
 
Function MyFunctionName(varVal1, varVal2)
If isnull(varVal1) or varValue1<3) then
MyFunctionName="--"
Else
MyFunctionName=nz(VarVal2,0)
End If
End Function



Chris Nebinger
 
Back
Top