Remove "#Error" from a Report

G

Guest

This is a second post, because I think the first was lost because I was
forced to log in again. If not, my apologies.

I have a telephone list on which #Error appears whenever a the telephone
field is blank. The control name for the number is txtPhone2, which draws its
data from another calculated control, txtPhone. The purpose of the latter is
to format the telephone number (xxx) xxx-xxxx, if the parentheses were not
hard-coded when the number was entered.

Here is the calculation for txtPhone2, which I had hoped would eliminate
#Error, but does not: =IIf([txtPhone]=Null, Null, [txtPhone]).
Here is the formatting calculation:
=IIf(Left$([Phone],1)="(",[Phone],Format([Phone],"(@@@) @@@-@@@@")).

Would appreciate any help that can be given to address this issue.
 
F

fredg

This is a second post, because I think the first was lost because I was
forced to log in again. If not, my apologies.

I have a telephone list on which #Error appears whenever a the telephone
field is blank. The control name for the number is txtPhone2, which draws its
data from another calculated control, txtPhone. The purpose of the latter is
to format the telephone number (xxx) xxx-xxxx, if the parentheses were not
hard-coded when the number was entered.

Here is the calculation for txtPhone2, which I had hoped would eliminate
#Error, but does not: =IIf([txtPhone]=Null, Null, [txtPhone]).
Here is the formatting calculation:
=IIf(Left$([Phone],1)="(",[Phone],Format([Phone],"(@@@) @@@-@@@@")).

Would appreciate any help that can be given to address this issue.

Use IsNull() not = Null.

=IIf(IsNull([Phone]),"",[txtPhone])

= IIf(IsNull([Phone]),"",IIf(Left$([Phone],1) =
"(",[Phone],Format([Phone],"(@@@) @@@-@@@@")))
 
G

Guest

The IsNull in the formatting statement did the trick. Thank you So Much!
--
susan


fredg said:
This is a second post, because I think the first was lost because I was
forced to log in again. If not, my apologies.

I have a telephone list on which #Error appears whenever a the telephone
field is blank. The control name for the number is txtPhone2, which draws its
data from another calculated control, txtPhone. The purpose of the latter is
to format the telephone number (xxx) xxx-xxxx, if the parentheses were not
hard-coded when the number was entered.

Here is the calculation for txtPhone2, which I had hoped would eliminate
#Error, but does not: =IIf([txtPhone]=Null, Null, [txtPhone]).
Here is the formatting calculation:
=IIf(Left$([Phone],1)="(",[Phone],Format([Phone],"(@@@) @@@-@@@@")).

Would appreciate any help that can be given to address this issue.

Use IsNull() not = Null.

=IIf(IsNull([Phone]),"",[txtPhone])

= IIf(IsNull([Phone]),"",IIf(Left$([Phone],1) =
"(",[Phone],Format([Phone],"(@@@) @@@-@@@@")))
 

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