Is there a way to highlight a null value in a report?
I created a report off a query to show records that are incomplete.
For example: Name, Address, Eyecolor, Hair Color, Race, Gender
It pulled up about 1200 records that are incomplete.
I would like to highlight the fields that are null.
For example: Someone entered a record and neglected to enter the Eye Color.
This way it might be easier to easily detect the missing data on the report.
Can this be done with code?
By placing code into the OnFormat event of the section (usually the Details section) which contains the Control or Controls you what to color that are Null, you can....
be field specific with something like:
If IsNull(Me.myReportControlName) Then
'In case the Controls' BackStyle is set to Transparent
'we set it to Normal
Me.myReportControlName.BackStyle = 1
'If the field is Null then change the BackColor to Red
'and the Font color White.
Me.myReportControlName.BackColor = vbRed
Me.myReportControlName.FontColor = vbWhite
'If the field is Not Null then make the BackColor White
'And The Font Color Black.
Me.myReportControlName.BackColor = vbWhite
Me.myReportControlName.FontColor = vbBlack
Or do it globally with:
Dim Ctrl As Control
On Error Resume Next
For Each Ctrl In Me.Controls
If IsNull(Ctrl) Then
Ctrl.BackStyle = 1
Ctrl.BackColor = vbRed
Ctrl.FontColor = vbWhite
Ctrl.BackColor = vbWhite
Ctrl.FontColor = vbBlack