I am trying to look into an Access table. If certain conditions are met, I want the variable CompactorDate to store the date. The code works fine if the DLookup function returns a date. The program errors out if DLookup returns Null. The IF loop doesn't seem to solve the problem either. The error is: "Invalid use of Null"
Dim CompactorDate As Date
If CompactorDate = Null Then
CompactorDate = "1/11/1999 10:00:00 PM"
Else
CompactorDate = DLookup("EPCTimeStamp", "qryTempData", "EPCStatusDesc='Compactor' ")
End If
Any ideas on how I can solve the Null problem?
Thanks
Dim CompactorDate As Date
If CompactorDate = Null Then
CompactorDate = "1/11/1999 10:00:00 PM"
Else
CompactorDate = DLookup("EPCTimeStamp", "qryTempData", "EPCStatusDesc='Compactor' ")
End If
Any ideas on how I can solve the Null problem?
Thanks