I am using the following code:
Option Compare Database
Option Explicit
Private Sub Reset_Background()
Dim lblCtrl As Control
For Each lblCtrl In Report
If lblCtrl.ControlType = acLabel Then
lblCtrl.BackColor = vbWhite
End If
Next
End Sub
Private Sub Pick5_Highlight(ByVal lngTag As Long)
'Purpose: Tales the value of the specific
' TextBox value - txtPick_01 through
' txtPick_06 and highlights thw
' corresponding label
'Parameters: lngValue As Long - Value inside TextBox
'Returns: Nothing
Dim lblCtrl As Control
For Each lblCtrl In Report
If lblCtrl.ControlType = acLabel Then
Debug.Print (CStr(lblCtrl.Tag))
If CLng(lblCtrl.Tag) = lngTag Then
lblCtrl.BackColor = vbYellow
End If
End If
Next
End Sub
Private Sub Detail_Paint()
Dim txtCtrl As Control, _
lngTag As Long, _
strLB As String
For Each txtCtrl In Report
Select Case txtCtrl.Name
Case "txtPick_01"
lngTag = CLng(txtCtrl.Value)
Call Pick5_Highlight(lngTag)
DoEvents
Case "txtPick_02"
lngTag = CLng(txtCtrl.Value)
Call Pick5_Highlight(lngTag)
DoEvents
Case "txtPick_03"
lngTag = CLng(txtCtrl.Value)
Call Pick5_Highlight(lngTag)
DoEvents
Case "txtPick_04"
lngTag = CLng(txtCtrl.Value)
Call Pick5_Highlight(lngTag)
DoEvents
Case "txtPick_05"
lngTag = CLng(txtCtrl.Value)
Call Pick5_Highlight(lngTag)
DoEvents
'Case "txtPick_06"
' lngTag = CLng(txtCtrl.Value)
' strLB = "lb_" & CStr(lngTag)
End Select
Next
End Sub
This is the desired output:
This is the actual output:"
Why is this occurring?
Thank you,
MRM256