Topic: Change of color of a field at data input
Hello! As I can not understand that I do not so. Visual check of entered values is necessary to me. When the operator enters the data, given are processed and, depending on result color of a cell changes.
For an example made the form and wrote such code:
Private Sub p2_AfterUpdate () qBC End Sub Private Sub qBC () On Error Resume Next Dim q As String q = "" q = Nz (Val (Me! p2) - Val (Me! p0), No) Select Case q Case No Me! p2.BackColor = vbWhite Case Is> 0 <= 150 Me! p2.BackColor = vbGreen Case Is <0 Me! p2.BackColor = vbRed Case Is> 150 Me! p2.BackColor = vbYellow End Select Debug. Print q End Sub
But the code does not work how I planned. It is possible to tell, it at all does not work.
At once in a makeweight a question, whether it is possible to make so that color of a field changed at value input in the field, instead of after field update, as at me now. Tried to write the same code to event change, but it caused an error.