I have a simple variable defined as date:
Public GenerationDateValue As Date
I assign data to it using:
GenerationDateValue = Nz(Generation_Date.Value)
However in the following code whe executed it puts in: 12:00:00 AM for its value in it making it seem as if there is data in there even when I leave the field blank and mean for it to be ignored by the following code:
If the field is blank, shouldn't the NZ function just make it null and not fill in 12:00:00 AM for the value? Thanks
Public GenerationDateValue As Date
I assign data to it using:
GenerationDateValue = Nz(Generation_Date.Value)
However in the following code whe executed it puts in: 12:00:00 AM for its value in it making it seem as if there is data in there even when I leave the field blank and mean for it to be ignored by the following code:
Code:
If IsNull(GenerationDateValue) = False And IsNull(ToDateValue) = True Then
FirstChecked = True
qry = qry & "AND (((GenerationDate) LIKE '*" & GenerationDateValue & "*')) "
ElseIf IsNull(GenerationDateValue) = False And IsNull(ToDateValue) = False Then
GenerationDateValue = GenerationDateValue - 1
ToDateValue = ToDateValue + 1
FirstChecked = True
qry = qry & "AND (((GenerationDate) > #" & GenerationDateValue & "#)) "
qry = qry & "AND (((GenerationDate) < #" & ToDateValue & "#)) "
End If
If the field is blank, shouldn't the NZ function just make it null and not fill in 12:00:00 AM for the value? Thanks