Our programmer set up this form many years ago and I would like to find out where the code is

access2010

Registered User.
Local time
Today, 05:45
Joined
Dec 26, 2009
Messages
1,154
If the "Stop Current $" and the "Percentage % Stop to Current Price" is "HIGHER" than the cost price, the Background would be Green,

If the "Stop Current $" and the "Percentage % Stop to Current Price" is "BELOW" the cost price the Background would be Red,

Your assistance will be appreciated.

Frida
 

Attachments

Did you check if there's Conditional Formatting applied to it?
 
On your form X_Investments_StockBrowse_F, enter form design mode. The menu line at the top will include "Form Design", "Arrange", and "Format." Click Format. Now click the "Percentage" control in your form's Detail section. (That's the control that actually changes color.) Finally in the ribbon for Control Formatting, click "Conditional Format" and you will see where this is done.
 
If the "Stop Current $" and the "Percentage % Stop to Current Price" is "HIGHER" than the cost price, the Background would be Green,

If the "Stop Current $" and the "Percentage % Stop to Current Price" is "BELOW" the cost price the Background would be Red,

Your assistance will be appreciated.

Frida
yes it is on the Conditional Format of Percentage (PC) textbox.
to view, goto design view of your form, click on the Percentage (PC) textbox.
on the Menu->Format->Conditional Formatting..
fc.jpg


but unfortunately it is being format for it's value only and not "comparing" to the "cost price".
 
If you want to compare to cost, need to modify each conditional rule to reference appropriate field or control or expression in place of of "0". Possibly:

[Stop_Current] > [TotalCost_$] AND [Text523] > [TotalCost_$]

[Stop_Current] < [TotalCost_$] AND [Text523] < [TotalCost_$]

Expression for Text523: =([Current_Price]-[Stop_Current])/[Current_Price]*100

Advise not to use punctuation/special characters (such as =, $, #) in naming convention - only exception is underscore.
 
Last edited:
Did you check if there's Conditional Formatting applied to it?
Thank you, TheDBguy, for your suggestion, which can change the colour of each field. However we are trying to find where the code is for the calculations in this form which was created in about 2010

Frida
 
On your form X_Investments_StockBrowse_F, enter form design mode. The menu line at the top will include "Form Design", "Arrange", and "Format." Click Format. Now click the "Percentage" control in your form's Detail section. (That's the control that actually changes color.) Finally in the ribbon for Control Formatting, click "Conditional Format" and you will see where this is done.
Thank you for your suggestion, Docman.
I have tried your suggestion and if you look at the attached screenshot, you will see that I cannot see any calculations.

Could you please advise me as to what I am doing wrong?

Frida
 

Attachments

yes it is on the Conditional Format of Percentage (PC) textbox.
to view, goto design view of your form, click on the Percentage (PC) textbox.
on the Menu->Format->Conditional Formatting..
View attachment 121362

but unfortunately it is being format for it's value only and not "comparing" to the "cost price".
Thank you for your suggestion, Arnelgp.
I have tried your suggestion and as you can see in the attached screenshot, I cannot see any calculations.

Could you please advise me as to what I am doing wrong?
Could the problem be that I am using Access 2003?
We are trying to resolve all of our outstanding issues since 2010, before upgrading our Access databases to the current versions..

Frida
 

Attachments

Did you see post 5?

The "code" is the Conditional Formatting rules.

Use of Access 2003 is not issue.
 
Last edited:
The calculations are right there in your screenshot. Right below the Default Formatting which applies Yellow, the next conditional format says,

"Condition 1 Field Value Is greater than or equal to 0" then Green is applied.
 
I wonder if the OP means the calculation of each value- which could be in the controlsource, the form recordsource or vba on some event
 
If you want to compare to cost, need to modify each conditional rule to reference appropriate field or control or expression in place of of "0". Possibly:

[Stop_Current] > [TotalCost_$] AND [Text523] > [TotalCost_$]

[Stop_Current] < [TotalCost_$] AND [Text523] < [TotalCost_$]

Expression for Text523: =([Current_Price]-[Stop_Current])/[Current_Price]*100

Advise not to use punctuation/special characters (such as =, $, #) in naming convention - only exception is underscore.
 
Thank you June7 for your information which is P.E.R.F.E.C.T. for our needs.
I could not reply earlier because we were having difficulty with our power supply.

Could you, please look at the updated database and advise us how to change the background colour of the field “$_Percentage”?

If the Percentage is negative, the background would be red, and if the Percentage is positive, the background should be Green.

I / we appreciate your assistance.
Frida
 

Attachments

Access2010/Frida,

i added the conditional format to the textbox $_Percentage.
the field source is a short text, but i did not change it to number.
because i don't know if other forms are saving the value to this field.

please see the Conditional Format of this textbox in design view.
 

Attachments

Users who are viewing this thread

Back
Top Bottom