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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error 6: Overflow Error 1

Status
Not open for further replies.

JasGrand

Programmer
Joined
Jan 8, 2003
Messages
144
Location
CA
Hello, I'm getting a runtime error 6: Overflow error on the following line of code:

ThisReportDepMin = IIf(Not (DepMinCount = 0), Format((DepMin) / (DepMinCount), "Fixed"), "0")

In this example, all of the above fields are equal to zero.
If there are numbers greater then 0 in these fields, the formula works. Any help is appreciated.

Thanks,

Jason Grandmaison
 
By the way, the error only occurs when the DepMinCount variable is equal to zero.

Thanks again,

Jason Grandmaison
 
An immediate if statement evaluates both parts of the statement (true and false) no matter which is correct. This means you're forcing it to divide by zero, which is giving you an overflow error. See what you can do to rebuild this in a way that doesn't force division by zero.

Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Hello, Thanks for answering. I already figured that out about the IIF statement so I reverted back to the standard IF THEN ELSE statement.

Thanks again,

Jason Grandmaison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top