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  

Hiding a #Num! occurrence in a report output



 
 
Thread Tools Display Modes
  #1  
Old December 3rd, 2009, 09:49 AM posted to microsoft.public.access.reports
Stephen Brown
external usenet poster
 
Posts: 5
Default Hiding a #Num! occurrence in a report output

I have a report that calculates a series of percentages based on the report
calculated.

Sometimes, however this results in a divided by zero calculation which then
appears in the report as #Num!

Is there an simple way of making the result box appear empty is there is a
division by zero result or having the text "N/A" appear instead?

Thanks



  #2  
Old December 3rd, 2009, 02:11 PM posted to microsoft.public.access.reports
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Hiding a #Num! occurrence in a report output

Stephen,
You can use the NZ function in your calculation, to prevent Null
values from interfering with the calculation.
Or... use an IIF statement in the ControlSource of your control to
determine if an element of the calculation will cause the error, or not.

IFF([Y] = 0, "N/A", [X] / [Y])
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Stephen Brown" wrote in message
...
I have a report that calculates a series of percentages based on the report
calculated.

Sometimes, however this results in a divided by zero calculation which
then
appears in the report as #Num!

Is there an simple way of making the result box appear empty is there is a
division by zero result or having the text "N/A" appear instead?

Thanks





  #3  
Old December 3rd, 2009, 05:35 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Hiding a #Num! occurrence in a report output

I'm sure what Al meant to use was IIf() not IFF() ;-)
=IIf([Y] = 0, "N/A", [X] / [Y])

--
Duane Hookom
Microsoft Access MVP


"Al Campagna" wrote:

Stephen,
You can use the NZ function in your calculation, to prevent Null
values from interfering with the calculation.
Or... use an IIF statement in the ControlSource of your control to
determine if an element of the calculation will cause the error, or not.

IFF([Y] = 0, "N/A", [X] / [Y])
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Stephen Brown" wrote in message
...
I have a report that calculates a series of percentages based on the report
calculated.

Sometimes, however this results in a divided by zero calculation which
then
appears in the report as #Num!

Is there an simple way of making the result box appear empty is there is a
division by zero result or having the text "N/A" appear instead?

Thanks





.

  #4  
Old December 3rd, 2009, 11:47 PM posted to microsoft.public.access.reports
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Hiding a #Num! occurrence in a report output

Thanks Duane... a typo.
"IIF" only I had my intellesense... :-D
Al Campagna

"Duane Hookom" wrote in message
...
I'm sure what Al meant to use was IIf() not IFF() ;-)
=IIf([Y] = 0, "N/A", [X] / [Y])

--
Duane Hookom
Microsoft Access MVP


"Al Campagna" wrote:

Stephen,
You can use the NZ function in your calculation, to prevent Null
values from interfering with the calculation.
Or... use an IIF statement in the ControlSource of your control to
determine if an element of the calculation will cause the error, or not.

IFF([Y] = 0, "N/A", [X] / [Y])
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

"Stephen Brown" wrote in message
...
I have a report that calculates a series of percentages based on the
report
calculated.

Sometimes, however this results in a divided by zero calculation which
then
appears in the report as #Num!

Is there an simple way of making the result box appear empty is there
is a
division by zero result or having the text "N/A" appear instead?

Thanks





.



  #5  
Old December 4th, 2009, 08:14 AM posted to microsoft.public.access.reports
Stephen Brown
external usenet poster
 
Posts: 5
Default Hiding a #Num! occurrence in a report output

Many thanks - that worked fine.

Stephen

"Al Campagna" wrote:

Thanks Duane... a typo.
"IIF" only I had my intellesense... :-D
Al Campagna

"Duane Hookom" wrote in message
...
I'm sure what Al meant to use was IIf() not IFF() ;-)
=IIf([Y] = 0, "N/A", [X] / [Y])

--
Duane Hookom
Microsoft Access MVP


"Al Campagna" wrote:

Stephen,
You can use the NZ function in your calculation, to prevent Null
values from interfering with the calculation.
Or... use an IIF statement in the ControlSource of your control to
determine if an element of the calculation will cause the error, or not.

IFF([Y] = 0, "N/A", [X] / [Y])
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

"Stephen Brown" wrote in message
...
I have a report that calculates a series of percentages based on the
report
calculated.

Sometimes, however this results in a divided by zero calculation which
then
appears in the report as #Num!

Is there an simple way of making the result box appear empty is there
is a
division by zero result or having the text "N/A" appear instead?

Thanks





.



.

 




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 07:08 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.