How to write this as a function in the modules

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])))
 
C

Chris Nebinger

Function MyFunctionName(varVal1, varVal2)
If isnull(varVal1) or varValue1<3) then
MyFunctionName="--"
Else
MyFunctionName=nz(VarVal2,0)
End If
End Function



Chris Nebinger
 

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