how do i replace "#NUM!" AND "#DIV/0!" in my reports?

gino

Registered User.
Local time
Today, 21:01
Joined
Mar 16, 2000
Messages
117
when i pull up the report sometimes text values appear because of invalid values or calculations such as "#NUM!" AND "#DIV/0!".

i don't want to confuse the user who is pulling up this report. i want to replace these text to my own personal text. is this possible.

for example, if #NUM! appears i want it to have a value of 0.

if anyone can help i would be greatful. thanks to all in advance.
 
this may help you Im not sure.
In the format event of whatever header your getting that stuff in try this:
If fieldname= "" Or IsNull(fieldname) Or IsEmpty(fieldname) then

fieldname = "0"
end if

I think something along those lines may work if not just ignore me.
Rpb
 
pat thanks for your help but the code seem not to work. i'm not familiar w/ nz function. could you help me out if possible?
 
pat here is my code i got from you and i just filled them in.

IIf(Nz([SumOfS1])0) = 0, 0, FldA/[SumOfS1])

sorry pat i'm plain clueless about this one.
 
Hi Pat,
Thanks for the information. You just solved a problem I've been wrestling with since yesteday!
 
Pat,
Can you do the same type of thing in a form? Thanks.

Kris

[This message has been edited by kkulick (edited 07-21-2000).]
 
Re: how do i replace "#NUM!" AND "#DIV/0!" in my reports?

Very sorry about the necro-post, but I've got an issue related to the one described above.

I've tried

IIf(Nz([Field1],0) = 0, 0, FldA/[Field1])

But that only gave me an error message.

I've also tried

NZ(Sum([Field1]*[Field2]),0

as suggested elsewhere, and edited it like this:

NZ(Sum([Field1]/[Field2]),0

but that doesn't do anything at all.

I apologize again for necro-posting, but it's fairly important (it's for my job, not school).

Thanks!!
 
Re: how do i replace "#NUM!" AND "#DIV/0!" in my reports?

I've tried

IIf(Nz([Field1],0) = 0, 0, FldA/[Field1])

But that only gave me an error message.
What is the error message? An error message is not the same as #Error.
 
Re: how do i replace "#NUM!" AND "#DIV/0!" in my reports?

You should always state what your error message is as we are not telepathic.

As for these
NZ(Sum([Field1]/[Field2]),0
How can that sum give a Null .

Brian
 
Re: how do i replace "#NUM!" AND "#DIV/0!" in my reports?

The problem has been solved, thanks anyway :)
 

Users who are viewing this thread

Back
Top Bottom