Form Field/Function problem

M

messingerjc

I have 4 fields on my main form. The 4th field is controlled by a function.
The function automatically adds the scores from the other 3 fields and puts
the total score in the 4th field. All of that works great. The problem I'm
having is that I need the color on that 4th field to change if any of the
other 3 fields are below 60 points. I've tried adding some code that would
change the color, under the 'After Update' and 'After Change' property field
and I can't get it to work at all. Thank you in advance for any help!
 
K

kc-mass

Place a procedure like this air code in each of the three text boxes that
you total.

Private Sub txtOne_AfterUpdate()
Dim lngYellow As Long
Dim lngWhite As Long
lngYellow = RGB(255, 255, 0)
lngWhite = RGB(255, 255, 255)
If Nz(txtOne.Value) < 60 Or Nz(txtTwo.Value) < 60 Or Nz(txtThree.Value)
< 60 Then
Me!txtTotal.BackColor = lngYellow
Else
Me!txtTotal.BackColor = lngWhite
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top