E
Evi
My database records how often some bowling greens are treated (eg for
fungus, top dressing).
One table tells me how many months until the next treatment and a query (not
my Report's one) shows the latest (max) date when a particular treatment
will be required for a particular green.
My report contains all the dates for the year next to each of the Bowling
Greens
and I want to colour a date next to that Green if it is a date that appears
in the query. This is the code I have in the report:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim MyLook As Variant
Dim MyWhite As Long
Dim MyRed As Long
MyWhite = 16777215
MyRed = 8421631
MyLook = Nz(DLookup("[TDate]", "QryLastTreatmentDue", "[MaxOfRptDue]= #" &
Me.TDate & "# AND [GreenID] = " & Me.GreenID))
If MyLook <> 0 Then
'the date is in the report
Me.TAbr.BackColor = MyRed
Else
Me.TAbr.BackColor = MyWhite
End If
End Sub
I get a type mismatch if the date is found. How can I overcome this?
Evi
fungus, top dressing).
One table tells me how many months until the next treatment and a query (not
my Report's one) shows the latest (max) date when a particular treatment
will be required for a particular green.
My report contains all the dates for the year next to each of the Bowling
Greens
and I want to colour a date next to that Green if it is a date that appears
in the query. This is the code I have in the report:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim MyLook As Variant
Dim MyWhite As Long
Dim MyRed As Long
MyWhite = 16777215
MyRed = 8421631
MyLook = Nz(DLookup("[TDate]", "QryLastTreatmentDue", "[MaxOfRptDue]= #" &
Me.TDate & "# AND [GreenID] = " & Me.GreenID))
If MyLook <> 0 Then
'the date is in the report
Me.TAbr.BackColor = MyRed
Else
Me.TAbr.BackColor = MyWhite
End If
End Sub
I get a type mismatch if the date is found. How can I overcome this?
Evi