Using <% in conditional formatting (1 Viewer)

jjake

Registered User.
Local time
Today, 04:33
Joined
Oct 8, 2015
Messages
291
Hello,

I have 2 fields in a form. [Budget] and [RemainingBudget].

I would like to use conditional formatting so that when the remaining budget falls less then 10% of the remaining budget the text will turn yellow.

How would i write this?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:33
Joined
Oct 29, 2018
Messages
21,498
Hi,

How about?

(Budget-Remaining)/Budget <= 0.1

Hope it helps...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:33
Joined
Feb 28, 2001
Messages
27,236
Well, we can do that, but the question is WHERE do you want this to happen? And when are you likely to discover that this has happened. DBguy points out that you can do a simple computation, but your lack of further description of the "when" and "where" makes it tough to finish the job. Help us a little so we can help you.

You say it is on a form but is the form bound to an underlying table? Or what other context applies to this situation?
 

Cronk

Registered User.
Local time
Today, 19:33
Joined
Jul 4, 2013
Messages
2,772
Um, that would be
Remaining/Budget < 0.1


Doc, the form does not need to be bound.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:33
Joined
Feb 28, 2001
Messages
27,236
Cronk, the question is, in which event or circumstance will this condition first be recognized so that you CAN trigger a color change?

If it is bound, the solution is (perhaps) in an OnCurrent event.

If it is unbound, then WHEN does the change occur? It might be best in an OnChange or a LostFocus event, but we need a FEW more particulars.
 

Cronk

Registered User.
Local time
Today, 19:33
Joined
Jul 4, 2013
Messages
2,772
With conditional formatting, the system handles everything. There's not need to add code to any event trigger, either onCurrent or onChange.
 

Users who are viewing this thread

Top Bottom