From: messingerjc on 12 Apr 2010 00:11 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!
From: kc-mass on 12 Apr 2010 07:19 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 "messingerjc" <messingerjc(a)discussions.microsoft.com> wrote in message news:D93FA196-AA56-4053-B00E-56F2163AAD8A(a)microsoft.com... >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!
|
Pages: 1 Prev: Change color on date field in form for re-certification Next: Switching from Normal to Dialog |