Null Values Hell - Help! (1 Viewer)

FrostByte

Registered User.
Local time
Today, 23:42
Joined
Jan 15, 2015
Messages
56
Hi All,

I'm really struggling here with Null values!

I have a query (outstanding amounts) which feeds a subform and in turn a main form.

This works well and the values are presented as they should.

My issue is however when the query returns null i.e there is no outstanding values for a given client.

The reason is I'm trying to run an if statement on the value to say if Outstanding is > than another value then prevent inputting. This works if theirs a value but if its null I get an error in my code saying "Run-time error '2427' "You entered an expression that has no value"

For the life in me I cannot get around this and cannot get it to generate even a zero (which would work)...


Any help would be huge!
Steve
 

missinglinq

AWF VIP
Local time
Today, 18:42
Joined
Jun 20, 2003
Messages
6,423
The Nz() Function can be used to work with a truly Null value, replacing it with whatever you want:

Code:
If Me.Outstanding > Nz(Me.AnotherValue, 0) Then

Linq ;0)>
 

Users who are viewing this thread

Top Bottom