Null testing

davesmith202

Employee of Access World
Local time
Today, 10:00
Joined
Jul 20, 2001
Messages
522
I want to check that there are values in both these variables: AvgCPC and rs!Revenue. But I don't think the check for Revenue is detecting the null.

If rs!AvgCPC <> 0 And Nz(rs!Revenue) <> 0 Then

What is faulty with that line of code?

Thanks,

Dave
 
There is a value in avgcpc so its not that.
 
Or you could try

If Nz(Field1,0) <> 0 and/or Nz(Field2,0) <> 0 then
.....
End If
 
DCrake, may I ask why you made that suggestion? Just checked that using the optional argument is only if you want to return a value other than zero if the condition is true.
 
All sorted now. It was working as expected. I found another part of code that misled me. Thanks anyway.
 

Users who are viewing this thread

Back
Top Bottom