Solved Is Not Null does not work (1 Viewer)

Sarah.M

Member
Local time
Today, 22:12
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is disabled security reason
Plz use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
---------------------------------------------------------------------------------------
Hi, I have [Field] type Date and Time and I have [Filed] type Number, I want to say if this Field is not Null show me message box, but macro does not recognize the syntax
I will show you my tries how do I write Is Not Null
and all of them does not work with me :(


Is Not Null([DateTime])
Is Not Null([DateTime])=0
Not IsNull([DateTime])
[DateTime] Is Not Null

Len([DateTime],0)
Len([DateTime])=0

Nz([DateTime],0)
Len(Nz([DateTime],0))

1635838894903.png


Plz help!
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Feb 19, 2013
Messages
16,618
'is not null' is sql syntax and will not work in vba and by extension macros (I don't use them)

so you need to use the isnull function,


if not isnull(myfield) then

or

if isnull(myfield)=false then
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:12
Joined
May 7, 2009
Messages
19,245
If Len([DateTime] & "") = 0

or just test if it is IsDate().
 

Users who are viewing this thread

Top Bottom