A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form Field/Function problem



 
 
Thread Tools Display Modes
  #1  
Old April 12th, 2010, 05:11 AM posted to microsoft.public.access.forms
messingerjc
external usenet poster
 
Posts: 4
Default Form Field/Function problem

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!
  #2  
Old April 12th, 2010, 12:19 PM posted to microsoft.public.access.forms
Kc-Mass
external usenet poster
 
Posts: 362
Default Form Field/Function problem

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" wrote in message
news
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!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.