How do I test for null condition of date datatype variables in MS-Access 2003

EE Experts,

I have the following 3 lines of code that give me an error message

     If Not (datShipDate Is Null) Then
                    !ShipDate = datShipDate
                End If

Open in new window


Run Time Error Message from VBA in MS-Access-2003
How can I test for a null value on a variable that is date datatype?
Ted PalmerInformation Technology ConsultantAsked:
Who is Participating?
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
in vba the syntax is:
If Not (isNull(datShipDate)) Then
                    !ShipDate = datShipDate
                End If

Open in new window

0
 
Ted PalmerInformation Technology ConsultantAuthor Commented:
Thank you Anders Ebro. That worked for just fine. I am embarassed to ask such a simple question. I found an answer in my wife's Alison Balter book that looked good, but yours was more complete and specific to my situation. I am a bit behind on this project so getting a quick answer was most helpful to me. Thank you.

Ted Palmer
0
 
Ted PalmerInformation Technology ConsultantAuthor Commented:
Thank you..!!
0
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
If its any comfort, switching back and forth between T-SQL and vba, I probably by accident (or because I am forgetfull) use the T-SQL syntax at least once a month, and then scratch my head until I remember my mistake.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.