Calculate only if field value is null

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Calculate only if field value is null

Post by bknight »

I attempted to calculate a value only when the field is null and Ms doesn't like my code.
If Fld5 = Null then
The code skips all records even when they are null values.
So what is the correct coding?

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Calculate only if field value is null

Post by HansV »

Null is not really a value, but the absence of a value, so you cannot use = Null in a comparison. Use the IsNull function instead:

If IsNull(Fld5) Then
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Calculate only if field value is null

Post by bknight »

Thanks