I would like to change the color of a field in my access database depending whether the user makes a change to that field or not. Here's what I got:
On the ONFOCUS event of the field I have:
Private Sub LocationID_GotFocus()
Me.LocationID.BackColor = 13434828
End Sub
This changes the color of the field to green when the user is on that field. Then on the LostFocus event of that field I have the following event:
Private Sub LocationID_LostFocus()
If Dirty Then
Me.LocationID.BackColor = 10092543
Else
Me.LocationID.BackColor = 16777215
End If
End Sub
If the user changes the value the field changes color to yellow. If no change is done the field stays white when the user moves on.
The problem I'm having is one a user has changed one field and that field changes color, the rest of the fields change to yellow automatically whether or not a change has been done to that field.
Can someone tell me why I'm getting this output?
Thank you!
On the ONFOCUS event of the field I have:
Private Sub LocationID_GotFocus()
Me.LocationID.BackColor = 13434828
End Sub
This changes the color of the field to green when the user is on that field. Then on the LostFocus event of that field I have the following event:
Private Sub LocationID_LostFocus()
If Dirty Then
Me.LocationID.BackColor = 10092543
Else
Me.LocationID.BackColor = 16777215
End If
End Sub
If the user changes the value the field changes color to yellow. If no change is done the field stays white when the user moves on.
The problem I'm having is one a user has changed one field and that field changes color, the rest of the fields change to yellow automatically whether or not a change has been done to that field.
Can someone tell me why I'm getting this output?
Thank you!