Changed Unboud Text Box Forecolor thru Code???

pcdummy

Registered User.
Local time
Today, 15:30
Joined
May 9, 2001
Messages
45
hi guys. I have looked thru the posts here, and have found some that are close.. But none that works for my particular case..

I have a currency formatted and unbound calculated text box that displays a calculated currency amount

If Me![TotalEquity] <= 0 Then
Me![TotalEquity].ForeColor = RGB(255, 0, 0)
Else
Me![TotalEquity].ForeColor = RGB(0, 255, 0)
End If

Basically I want a postive amount to return a green text color and a negative amount to return a red text color. The above code does not work... please give direction...not much hair left at this point..

Thanks
Jeff
 
Try This:

If Me.TotalEquity <= 0 Then
Me.TotalEquity.forecolor = vbRed
Else
Me.TotalEquity.Forecolor = vbGreen
End If

I think that this will work for you.

Good luck,
Peter Paul
 
Thanks for the quick reply Peter Paul; however now my figure is ALWAYS red.. Same thing that happened with my original code.. I am thinking it has something to do with the negative currency format.. Any more suggestions GREATLY Appreciated..

Thanks again

Jeff
 
Since your dealing with currency just set the format to
$#,##0.00[Green];$#,##0.00[Red]or $#,##0.00[Green];($#,##0.00)[Red]
 
Thanks Rich Worked great...

How stupid of me...

Thanks again
jeff
 

Users who are viewing this thread

Back
Top Bottom