Solved Highlight field (1 Viewer)

EdwardsC

New member
Local time
Today, 06:33
Joined
Jul 10, 2019
Messages
21
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

Well-known member
Local time
Today, 09:33
Joined
Apr 9, 2015
Messages
4,339
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

..forever waiting... waiting for jellybean!
Local time
Today, 21:33
Joined
May 7, 2009
Messages
19,175
I have a demo database (a2019).
 

Attachments

  • ClosestAverage.accdb
    560 KB · Views: 109

EdwardsC

New member
Local time
Today, 06:33
Joined
Jul 10, 2019
Messages
21
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, 06:33
Joined
Jul 10, 2019
Messages
21
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

..forever waiting... waiting for jellybean!
Local time
Today, 21:33
Joined
May 7, 2009
Messages
19,175
if you can upload a sample db, i will incorporate the functions there.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:33
Joined
May 7, 2009
Messages
19,175
i have another look at the code.
 

Attachments

  • ClosestAverage.accdb
    472 KB · Views: 111

EdwardsC

New member
Local time
Today, 06:33
Joined
Jul 10, 2019
Messages
21
@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