Help with IIF count of date field

weilerdo

Registered User.
Local time
Today, 18:14
Joined
Apr 21, 2005
Messages
109
Hi All, I think I have tried almost every IIF count that I can find on here and I am getting errors on them. What I have is a Form that I have a text box that gets populated by a popup calendar ( txtDate1 ) which is working fine. I have another text box ( txtcnt1 ) that I need to get a value ( 1, 0 ) in from txtDate1. There will not always be a value in txtDate1 so I have tried the following.

=Sum(IIF([txtDate1]="",1,0)) or
=IIF([txtDate1] Is Null,1,0) or
=IIF([txtDate1]="##",1,0)

I believe I am not getting a result because txtDate1 is a date field. Any help would be greatly appreciated.

Thank you
 
To check for NULL you need =IIf(IsNull([TxtDate1]),"1","0")

you can also check is ISDATE =IIf(IsDate([TxtDate1]),"1","0")
 
Thanks Vodafrog, That was the ticket it worked great..................
 

Users who are viewing this thread

Back
Top Bottom