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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Conditional Formatting Using Color Code

Status
Not open for further replies.

DDTiff

MIS
May 29, 2002
48
US
Hello,

Can someone please help me with the question below? Your time and help are truly appreciated.

I have a form called Purchase with a default view as datasheet. The Purchase datasheet consists of five fields: Vendor ID, Product Name, Price, Quantity, Total$(Quantity * Price). I also have a txtTotalPurchase at the bottom of the datasheet.

My goal is to create a color code configuration control to either change the text color or forecolor of the cell of the Total$ when there is a change in the value.

For example, when I first open the Purchase form the Total$ for Vendor ID #102 was $100 (10*$10), and I've decided to increase the Quantity from 10 to 20. The Total$ now came out to be $200 instead of $100. I hope to see either the value $200 change color or the backcolor/forecolor of the cell that contains the $200 changes color.

Once again, I thank you for your help in advance.

Diem
 
If you are using Access 2000 or later, investigate the Conditional Formatting option in the Format menu on the Forms Design or Report Design menus.

If you are using Access 97, or the Conditional Formatting won't achieve what you require, another way to achieve this would be to use to textbox's OldValue property.

By comparing the textbox's Value property to the Oldvalue property you can determine if the field has been changed and then format the forecolour or backcolour as necessary

Access Help Topics:
About applying conditional formatting to a control
OldValue Property

HTH
Lightning
 
Thank you Lightning. I saw the conditional formatting in the tool bar, but I will look more in to it and try to write up a module that executes the procedure. Again, your time and effort are appreciated.

Diem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top