K
Kahuna
Hi Folks - this seems bizarre in the extreme.
I have an unbound field on a form where in the 'Current' event I am trying
to change the back-colour dependant upon the contents. Here's the code:
'Set CC Box Colour
Me![cc_value].BackColor = 16777215
Select Case [cc_value].Value
Case 1
Me![cc_value].BackColor = 255
Case 2
Me![cc_value].BackColor = 4227327
Case 3
Me![cc_value].BackColor = 65280
Case 4
Me![cc_value].BackColor = 65535
Case 5
Me![cc_value].BackColor = 16776960
Case 6
Me![cc_value].BackColor = 16776960
End Select
The effect is that the colour changes appear to lag behind as I cursor
through the records on this form. i.e. contents '1' appears red, and on
cursoring to a contents '5' for example - it remains red until I come across
a different contents. Going back to the '5' plays it in its correct colour.
I tried Me.Refresh and Me.Repaint both in the 'Current' even to no avail!
Should this be running in a different event?
Any comments or advice appreciated.
Cheers
I have an unbound field on a form where in the 'Current' event I am trying
to change the back-colour dependant upon the contents. Here's the code:
'Set CC Box Colour
Me![cc_value].BackColor = 16777215
Select Case [cc_value].Value
Case 1
Me![cc_value].BackColor = 255
Case 2
Me![cc_value].BackColor = 4227327
Case 3
Me![cc_value].BackColor = 65280
Case 4
Me![cc_value].BackColor = 65535
Case 5
Me![cc_value].BackColor = 16776960
Case 6
Me![cc_value].BackColor = 16776960
End Select
The effect is that the colour changes appear to lag behind as I cursor
through the records on this form. i.e. contents '1' appears red, and on
cursoring to a contents '5' for example - it remains red until I come across
a different contents. Going back to the '5' plays it in its correct colour.
I tried Me.Refresh and Me.Repaint both in the 'Current' even to no avail!
Should this be running in a different event?
Any comments or advice appreciated.
Cheers