A
Andrew
I have a subform with a dynamic amount of textboxes. Each
textbox should have its own color, based on the field
L3_Status. I am trying to set up FormatConditions to
accomplish this, but I keep getting the following error:
"Run-time error '91'
Object variable or With block variable not set"
I have no idea what is wrong. Here is the main part of my
code:
Dim lngRed As Long
Dim lngBlue As Long, lngYellow As Long, lngGreen As
Long
Dim lngGray As Long, lngWhite As Long, lngBlack As Long
Dim isBlue As FormatCondition
'**********************************************************
***
'Set the Status Colors for Level 3 Forecast Finish dates
lngRed = RGB(255, 0, 0)
lngBlue = RGB(37, 145, 241)
lngYellow = RGB(255, 255, 0)
lngGreen = RGB(0, 155, 0)
lngGray = RGB(100, 100, 100)
lngWhite = RGB(255, 255, 255)
lngBlack = RGB(0, 0, 0)
With isBlue
' .ForeColor = lngWhite
' .BackColor = lngBlue
' .FontBold = True
End With
L3_Status.FormatConditions.Add acFieldValue,
acEqual, "B" = isBlue
textbox should have its own color, based on the field
L3_Status. I am trying to set up FormatConditions to
accomplish this, but I keep getting the following error:
"Run-time error '91'
Object variable or With block variable not set"
I have no idea what is wrong. Here is the main part of my
code:
Dim lngRed As Long
Dim lngBlue As Long, lngYellow As Long, lngGreen As
Long
Dim lngGray As Long, lngWhite As Long, lngBlack As Long
Dim isBlue As FormatCondition
'**********************************************************
***
'Set the Status Colors for Level 3 Forecast Finish dates
lngRed = RGB(255, 0, 0)
lngBlue = RGB(37, 145, 241)
lngYellow = RGB(255, 255, 0)
lngGreen = RGB(0, 155, 0)
lngGray = RGB(100, 100, 100)
lngWhite = RGB(255, 255, 255)
lngBlack = RGB(0, 0, 0)
With isBlue
' .ForeColor = lngWhite
' .BackColor = lngBlue
' .FontBold = True
End With
L3_Status.FormatConditions.Add acFieldValue,
acEqual, "B" = isBlue