Check table for missing date

  • Thread starter Thread starter Del
  • Start date Start date
D

Del

From a form I want to check a date field in a table to see if there is a date
there. I'm using the following code. I'm confident of the null check but
I'm not sure about the empty string. It seems like it should be ## instead
of "", but the compiler expects an expression when I use double #s.

If Not IsNull(DLookup("[Due]", "tblPMCurrentTask", "[TaskID]=" & Me.TaskID)) _
And (DLookup("[Due]", "tblPMCurrentTask", "[TaskID]=" & Me.TaskID)) <>
"" Then
 
You should not find an empty string in a date field. The Date/Time data type
is actually a floating point numeric field that carries the Year, Month, and
Day as a whole number and the time as the decimal part of the number.
 
Thank you for your help.
--
Thank you,
Del


Klatuu said:
You should not find an empty string in a date field. The Date/Time data type
is actually a floating point numeric field that carries the Year, Month, and
Day as a whole number and the time as the decimal part of the number.
--
Dave Hargis, Microsoft Access MVP


Del said:
From a form I want to check a date field in a table to see if there is a date
there. I'm using the following code. I'm confident of the null check but
I'm not sure about the empty string. It seems like it should be ## instead
of "", but the compiler expects an expression when I use double #s.

If Not IsNull(DLookup("[Due]", "tblPMCurrentTask", "[TaskID]=" & Me.TaskID)) _
And (DLookup("[Due]", "tblPMCurrentTask", "[TaskID]=" & Me.TaskID)) <>
"" Then
 
Back
Top