The intent is to cycle through text boxes on a reports detail section and
change the backcolor depending on the text box value.
the debug.print seems to indicate that the value is coming through, but the
backcolor isn't changing to correspond.
here's the code: (if anyone has more brains that me on this..I'm missing
something here)
Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
Dim ctl As Control
Dim strV
Const conTransparent = 0
Const conWhite = 16777215
Const conRed = 255
For Each ctl In Me.Controls
With ctl
If .ControlType = acTextBox And .Section = acDetail Then
strV = ctl
strV = Right(strV, 1)
.BackStyle = acNormal
Debug.Print ctl.Name
Debug.Print strV
Select Case strV
Case Is = "R"
.BackColor = 255
Case Is = "L"
.BackColor = 1
Case Else
End Select
End If
End With
Next ctl
End Sub
change the backcolor depending on the text box value.
the debug.print seems to indicate that the value is coming through, but the
backcolor isn't changing to correspond.
here's the code: (if anyone has more brains that me on this..I'm missing
something here)
Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
Dim ctl As Control
Dim strV
Const conTransparent = 0
Const conWhite = 16777215
Const conRed = 255
For Each ctl In Me.Controls
With ctl
If .ControlType = acTextBox And .Section = acDetail Then
strV = ctl
strV = Right(strV, 1)
.BackStyle = acNormal
Debug.Print ctl.Name
Debug.Print strV
Select Case strV
Case Is = "R"
.BackColor = 255
Case Is = "L"
.BackColor = 1
Case Else
End Select
End If
End With
Next ctl
End Sub
Comment