Solved Is Not Null does not work

Sarah.M

Member
Local time
Today, 04:11
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:
'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
 
If Len([DateTime] & "") = 0

or just test if it is IsDate().
 

Users who are viewing this thread

Back
Top Bottom