473,408 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Suppressin DIV/0 in Access reports

Hi,

I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.

Any ideas/work arounds would be greatly appreciated.

Regards
Mike
Nov 12 '05 #1
3 9275
"Mike" <mi*********@tiscali.co.uk> wrote in message
news:73**************************@posting.google.c om...
Hi,

I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

Rick,

On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote in comp.databases.ms-access:
I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)


That certainly answers the original question, but isn't the original
question suspect? Why does the OP want 0 to represent both 0/N and
0/0? In general, one should really be distinguishing between 0/0 and
0, or more specifically, the formula should be something like:

IIf(field2=0, 'n/a', field1/field2)

or, at least

IIf(field2=0, null, field1/field2)

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051
Nov 12 '05 #3
Thanks a lot guys - your solutions worked!
Peter Miller <pm*****@pksolutions.com> wrote in message news:<ul********************************@4ax.com>. ..
Rick,

On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote in comp.databases.ms-access:
I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)


That certainly answers the original question, but isn't the original
question suspect? Why does the OP want 0 to represent both 0/N and
0/0? In general, one should really be distinguishing between 0/0 and
0, or more specifically, the formula should be something like:

IIf(field2=0, 'n/a', field1/field2)

or, at least

IIf(field2=0, null, field1/field2)

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
5
by: Steven Taylor | last post by:
Hope someone can help. I have an application whereby in order to create one document type I effectively print out 3 or 4 access reports in correct order. So the user goes to the printer,...
1
by: Brian Barnes | last post by:
I've been searching using google trying to find a way to display Access Reports via ASP.NET and only finding commericial products which appear to require that the report needs to be converted every...
1
by: David | last post by:
Does anyone know how to run MS Access reports from VB.net. I'd like to keep the existing reports in the database if I can. Thanks David
0
by: dkurtz | last post by:
D. Lesandrini published an article some time ago about exporting Access reports as XML, and then updating those XML reports dynamically in ..NET....
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
3
by: booner | last post by:
Is there any way to show an existing access database (.mdb) report inside a vb.net application? Any/all pointers much appreciated. BBB
1
by: NeoDeGenero | last post by:
I have a little VBA/Access - Reports problem and I’m not sure on how to approach it: I am trying to send a Report generated by MS Access via email through the command SendObject. ...
0
by: Qtip23 | last post by:
Hello All, So I have a my database information placed on a SharePoint site now that there is an immediate need for a web-based application in my division. I am able to print Access Reports...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.