I'm using the following code to change the color of a box in a report based on the results of a query. It works great as long as the query returns at least one record. However, sometimes the query will not return any records (and shouldn't). In this case, I need the formatting code to be ignored. Can anyone help me understand how to do this?
Private Sub Format_Box(Cancel As Integer, FormatCount As Integer)
If Event_Type = "CONFIRMED" Then
Box195.BackColor = 10787187
Else
Box195.BackColor = 11177338
End If
End Sub
Private Sub Format_Box(Cancel As Integer, FormatCount As Integer)
If Event_Type = "CONFIRMED" Then
Box195.BackColor = 10787187
Else
Box195.BackColor = 11177338
End If
End Sub