Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message Dividing By 0

Status
Not open for further replies.

Brogrim

Technical User
Jul 28, 2000
184
IE
I have a few sub reports on my report, ecah one returns a value which is then used in a calculation. There are\ ties when 1 subreport will return a 0 which gives the error further along in the calculation, is there any error handling I can use to prevent the error message and getting a true number

Thaks for the help
 
Whenever I depend on a calculation to populate a field on a form or report I test for nulls and/or zero values (when dividing) using the immediate if function. ie.(=iif([FieldValue1]=0,0,([FieldValue2]/[FieldValue1])). In this way you only perform the division operation when the divisor has a non-zero value. If the divisor is=0 you can set the value to anything you desire without dividing and raising the /0 error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top