Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Color of Field on Continuous frm based on value

Status
Not open for further replies.

mckenneyj

MIS
Jun 1, 2002
96
Need to change the forcolor of a field based on the value

Record3 "AmtPaid" = 200.00
Record6 "AmmtPaid" = 0.00
Record8 "AmtPaid" = -50.00

Forecolor of 3 should be vbGreen
Forecolor of 6 should be vbBlack
Forecolor of 8 should be vbRed

So far all the things I have tried change all records to a specific color based on value of first record.

Thanks,
John McKenney
Work Hard... Play Harder
 
If you're using access 2000+ versions, take a look at conditional formatting in the format menu.

Programmatic changes to do conditional formating (access 97) is not easy. If you search these forums you'll probably find some workarounds with labels etc, but I don't know how they work

Roy-Vidar
 
Bill Power has an excellent post on conditional formatting on continuous forms...thread702-661512.
 
Hi mckenneyj,

Most attempts at conditional formatting in A97 have limited success, but in this case (assuming the field is numeric) you should be able to set the Format to something like ..

Code:
[
Green
Code:
]
0.00;
Code:
[
Red
Code:
]
-0.00;
Code:
[
Black
Code:
]
0.00


That will set the colours; the actual nuber format may not be quite what you want, but you can tweak it.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Do you put the information in the formatting of the text box?
Thanks,
Sharon
 
Hi Sharon,

Yes - if you're referring to the format I posted and using 97. If you're using 2000 or later, look at CF as Roy said.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top