A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Remove "#Error" from a Report



 
 
Thread Tools Display Modes
  #1  
Old July 18th, 2007, 07:56 PM posted to microsoft.public.access.reports
Susan L
external usenet poster
 
Posts: 85
Default Remove "#Error" from a Report

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.
--
susan
  #2  
Old July 18th, 2007, 08:16 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Remove "#Error" from a Report

On Wed, 18 Jul 2007 11:56:02 -0700, Susan L wrote:

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],"(@@@) @@@-@@@@")))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old July 18th, 2007, 09:04 PM posted to microsoft.public.access.reports
Susan L
external usenet poster
 
Posts: 85
Default Remove "#Error" from a Report

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


"fredg" wrote:

On Wed, 18 Jul 2007 11:56:02 -0700, Susan L wrote:

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],"(@@@) @@@-@@@@")))
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.