combining IIF statements

2wistd

Registered User.
Local time
Yesterday, 19:36
Joined
Jan 17, 2013
Messages
66
=IIf(IsNull([hphone]),"","h: " & [hphone])

So within one text box I want to have home, cell and work phone. If the field is empty, show nothing. With IIF i've figured how to do that for one. How do I code it for all 3? I've tried:

=IIf(IsNull([hphone]),"","h: " & [hphone]),IIf(IsNull([cphone]),"","h: " & [cphone])

for two, but that didn't work :(
Any help?
Thanks
 
Don't nest your IIf statements, concatenate them:

=IIf(IsNull([hphone]),"","h: " & [hphone] & ", ") & IIf(IsNull([cphone]),"","c: " & [cphone] & ", ") & IIf(IsNull([cphone]),"","w: " & [wphone])
 
Thanks, that worked wonderfully!
 

Users who are viewing this thread

Back
Top Bottom