Link to home
Create AccountLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Getting #Error on a report field

I have this control source for a field on a report but I'm getting #Error in the field if txtStandardWidthInInches is empty.

=IIf([txtStandardWidthInInches]="","",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

How can I get rid of the #Error ?
Avatar of Phillip Burton
Phillip Burton

try

=IIf(IsNull([txtStandardWidthInInches]),"",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

or

=IIf(nz([txtStandardWidthInInches],"")="","",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))
Avatar of SteveL13

ASKER

This did it...

=IIf(IsNull([txtStandardWidthInInches]),"",(CInt([txtStandardWidthInInches]/12) & "' " & [txtStandardWidthInInches] Mod 12 & """"))

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account