I have been working for several days to write code for a report in order to change the backcolor of a report control noted here as "[1]" if it is the maximum value in the field. I am almost there, but I am getting an error message I dont know how to deal with. Here is the code:
Option Compare Database
Dim lngmax As Long
Dim LNGYEL As Long
Dim LNGW As Long
Private Sub detail_format(Cancel As Integer, formatcount As Integer)
LNGYEL = 12632256
LNGW = 16777215
If Me![1].value = lngmax Then
Me![1].BackColor = LNGYEL
Else
Me![1].BackColor = LNGW
End If
End Sub
Private Sub Report_open(Cancel As Integer)
lngmax = DMax("[1]", "qtblsumlee", "[fa_cpmi_fac_def_grade_no]")
End Sub
The error message I get is "object does not support this property or method", and it points to the line of code
Me![1].Backcolor=lngw. And so forth. Any help in how to correct this is greatly appreciated!!
Option Compare Database
Dim lngmax As Long
Dim LNGYEL As Long
Dim LNGW As Long
Private Sub detail_format(Cancel As Integer, formatcount As Integer)
LNGYEL = 12632256
LNGW = 16777215
If Me![1].value = lngmax Then
Me![1].BackColor = LNGYEL
Else
Me![1].BackColor = LNGW
End If
End Sub
Private Sub Report_open(Cancel As Integer)
lngmax = DMax("[1]", "qtblsumlee", "[fa_cpmi_fac_def_grade_no]")
End Sub
The error message I get is "object does not support this property or method", and it points to the line of code
Me![1].Backcolor=lngw. And so forth. Any help in how to correct this is greatly appreciated!!