Conditional Formatting for Blank Date Field Not Working

Tophan

Registered User.
Local time
Today, 11:16
Joined
Mar 27, 2011
Messages
374
Hi,

I have a report which is based on a query that includes the following expression named "PreInstallationInspectionDate" (I know it's a long name)

Code:
DLookUp("[PreInspectionDate]","tblWorkOrder","CandidateID=" & [CandidateID])

In the report, I would like the PreInstallationInspectionDate field highlighted if the field is blank. I've tried using IsNull([PreInstallationInspectionDate]), Nz([PreInstallationInspectionDate]) and both IsNull and Nz with the Dlookup formula used in the query but nothing is working.

Any suggestions?
 
Is PreInspectionDate a Date/Time field? Does it have a Default Value?
 
If you use Nz() in your expression, what happens?
Code:
Nz(DLookup(...), "")
Then, in your Conditional Formatting, try to use:

Value Is: ""
 
I have a report which is based on a query that includes the following expression named "PreInstallationInspectionDate" (I know it's a long name)
I prefer pre_installation_inspection_date-much more readable and without spaces, otherwise square brackets will be needed
 
Why not check for Len() > 0 ?
 
If you use Nz() in your expression, what happens?
Code:
Nz(DLookup(...), "")
Then, in your Conditional Formatting, try to use:

Value Is: ""

Not getting the conditional formatting to work with the Nz or with the suggestion of Nz(Dlookup(...),"")
 
I prefer pre_installation_inspection_date-much more readable and without spaces, otherwise square brackets will be needed
Thanks. I couldn't find a shorter description for that field. I will try your suggestion.
 
Thanks. I couldn't find a shorter description for that field. I will try your suggestion.
You do know that fields have captions?, that can describe a field better on forms/reports?
If that was my DB the field would be called something along the lines of PreInstallInspDate or even shorter. :) and the caption Pre Installation Inspect Date.
 
I am not familiar with this one. Would I type Len([PreInstallationInspectionDate])>0?
Yes, or whatever the control name is.
Most people rename the control slightly to differentiate between field and control, like txtPreInstallationInspectionDate, making it even longer. :)
 
Yes, or whatever the control name is.
Most people rename the control slightly to differentiate between field and control, like txtPreInstallationInspectionDate, making it even longer. :)
That didn't work either :(
 
If you use Nz() in your expression, what happens?


Not getting the conditional formatting to work with the Nz or with the suggestion of Nz(Dlookup(...),"")
Hi. Can you post a sample db with test data to demonstrate the problem?
 
Is this what you mean?

Edit: File attachment deleted per OP's request.
 
Last edited:
Value Is: ""

"" is NOT the same as Null. "" is a Zero Length STRING and isn't even valid for dates which are numeric.

I used my own db for this sample so the date name is different from yours.

ConditionalFormattingIsNullJPG.JPG
 
Last edited:
Yes! That's what I need to highlight! So it's the order of the expression - [PreInstallationInspectionDate] Is Null

As always, thank you so much for your help 😃
 
I'm going to delete the DB from the forum. I really appreciate everyone's help on this.
 
Yes! That's what I need to highlight! So it's the order of the expression - [PreInstallationInspectionDate] Is Null

As always, thank you so much for your help 😃
That's just one way to do it. I figured if I could avoid using a function, then why not?

Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom