Solved Highlight field (1 Viewer)

EdwardsC

New member
Local time
Today, 15:00
Joined
Jul 10, 2019
Messages
11
I have a form with 6 fields where the user logs the weight of 6 bags (bag 1, bag 2, etc). I have another field that calculates the average weight once the bag weights are entered. I want access to highlight the bag closet to the value in the average weight field. This will help the user identify the bag closest to the average. Can I I set this up with an expression in conditional formatting? Thank you in advance!
 

Ranman256

Registered User.
Local time
Today, 18:00
Joined
Apr 9, 2015
Messages
3,698
conditional formatting will color the 1 field concerning the 1 field, but you want to know what's in all fields.
you may need to cycle thru all 6 fields to find the closest then color it:
txtBoxN.backcolor = vbYellow
 

arnelgp

error reading drive A:
Local time
Tomorrow, 07:00
Joined
May 7, 2009
Messages
11,146
I have a demo database (a2019).
 

Attachments

  • ClosestAverage.accdb
    560 KB · Views: 9

EdwardsC

New member
Local time
Today, 15:00
Joined
Jul 10, 2019
Messages
11
Thank you for the help and the functions in the demo make the form behave the way I want it too. The problem now is I am getting an error message “can’t assign a clue to this object”.
 

EdwardsC

New member
Local time
Today, 15:00
Joined
Jul 10, 2019
Messages
11
Thank you for the help and the functions in the demo make the form behave the way I want it too. The problem now is I am getting an error message “can’t assign a clue to this object”.
 

arnelgp

error reading drive A:
Local time
Tomorrow, 07:00
Joined
May 7, 2009
Messages
11,146
if you can upload a sample db, i will incorporate the functions there.
 

arnelgp

error reading drive A:
Local time
Tomorrow, 07:00
Joined
May 7, 2009
Messages
11,146
i have another look at the code.
 

Attachments

  • ClosestAverage.accdb
    472 KB · Views: 6

EdwardsC

New member
Local time
Today, 15:00
Joined
Jul 10, 2019
Messages
11
@arnelgp after trial and error I got the function to work. The after update event wouldn’t fire because of a calculated field.
Thank you for your help! This really improved the db
 

Users who are viewing this thread

Top Bottom