A
anglicanista
I want a continuous form with a calculated field. But the calculation is
complex - it calculates someone's age. I have a Function CalcAge() (the
'long' age calculation, not using datediff) but I can't see the way to refer
to it in an IIF statement if the birthdate isn't null. Putting this in the
control source for the age test box:
=IIf(IsNull([Birthdate]),0,CalcAge())
correctly gives me 0 if there's no birthdate, but "#Error" if there is one.
So is it even possible to use a sub or function in an IIF?
newB
complex - it calculates someone's age. I have a Function CalcAge() (the
'long' age calculation, not using datediff) but I can't see the way to refer
to it in an IIF statement if the birthdate isn't null. Putting this in the
control source for the age test box:
=IIf(IsNull([Birthdate]),0,CalcAge())
correctly gives me 0 if there's no birthdate, but "#Error" if there is one.
So is it even possible to use a sub or function in an IIF?
newB