my iff statement only shows the now() function (1 Viewer)

rainbows

Registered User.
Local time
Today, 11:00
Joined
Apr 21, 2017
Messages
425
hi ,

=IIf([Invoice paid] Is Null, "hello",Now())
this is what i put into my form but no matter if i tick the invoice paid button or not it only shows the date i want tot to be empty until i tick the box the dispaly the date i did that .

1660927644285.png




thanks
steve
 

Attachments

  • 1660927520738.png
    1660927520738.png
    271.9 KB · Views: 57

theDBguy

I’m here to help
Staff member
Local time
Today, 11:00
Joined
Oct 29, 2018
Messages
21,515
Hi Steve,

Checkboxes in Access cannot contain Nulls. They're either True or False. Try changing your expression to:
Code:
=IIf([Invoice paid]=False,"hello",Now())
Hope that helps...
 

rainbows

Registered User.
Local time
Today, 11:00
Joined
Apr 21, 2017
Messages
425
Thats great thank you
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:00
Joined
Sep 21, 2011
Messages
14,398
Or =IIf([Invoice paid], Now(),"hello") which is how I like to code the logic?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:00
Joined
Feb 19, 2013
Messages
16,651
For future reference’Is null’ only works in sql. In forms, vba you need to use the isnull function
 

Users who are viewing this thread

Top Bottom