G
Guest
Need code help! On a form filled with data generated from a query, I need to
format the textboxes based on the data in one of the fields. Conditional
formatting works great, but apparently the pastels aren’t pastel enough so I
have to use custom colors. Here’s the code:
Private Sub Form_Current()
If Me.txtGroup = "A" Then
Me.txtID.BackColor = 12122104
ElseIf Me.txtGroup = "B" Then
Me.txtID.BackColor = 15979518
ElseIf Me.txtGroup = "C" Then
Me.txtID.BackColor = 16776652
ElseIf Me.txtGroup = "D" Then
Me.txtID.BackColor = 16628703
End If
End Sub
The view is “continuous forms†so it shows all the rows of data returned by
the query. The above code is making all of the rows change color depending
on where the cursor is. If the row has a “Bâ€, then all the rows turn pink
(15979518). How do I make the rows show their respective color regardless of
where the cursor is?
format the textboxes based on the data in one of the fields. Conditional
formatting works great, but apparently the pastels aren’t pastel enough so I
have to use custom colors. Here’s the code:
Private Sub Form_Current()
If Me.txtGroup = "A" Then
Me.txtID.BackColor = 12122104
ElseIf Me.txtGroup = "B" Then
Me.txtID.BackColor = 15979518
ElseIf Me.txtGroup = "C" Then
Me.txtID.BackColor = 16776652
ElseIf Me.txtGroup = "D" Then
Me.txtID.BackColor = 16628703
End If
End Sub
The view is “continuous forms†so it shows all the rows of data returned by
the query. The above code is making all of the rows change color depending
on where the cursor is. If the row has a “Bâ€, then all the rows turn pink
(15979518). How do I make the rows show their respective color regardless of
where the cursor is?