Conditional Formatting on a report: Access 97

Dr_Worm

Board Regular
Joined
Jul 28, 2003
Messages
103
I have created a report in Access 97, with the following information:

Comp1, Comp2, Comp3, Comp4,…
Desp1, Desp2, Desp3 Desp4,….

They are all numeric fields. What I want to be able to do is have a boarder around “Desp1” if “Comp1” is greater than or equal to 1. The same for “Comp2” & “Desp2”, etc.
:rolleyes:
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
HI,
Make a border around each box and set its visible property to false. Then when one of your fields gets a value you could put code behind the on change event that says
if comp1 > whatever then border1.visible = true

try that.
 
Upvote 0
There seems to be no way to apply conditional formatting to borders, but here is a workaround that uses the fill color of a textbox, which CAN be conditionally formatted.

Add an unbound text box with its height and width just a couple of points more than "Desp1". Select it, and click Format > Send to back. Set its fill color and outline to transparent.

Align this text box so it is right behind "Desp1"... you will just see its edges like a border around Desp1. Add conditional formatting to fill it in black if your condition is met.
i.e., Condition 1 : "Expression is" ([Comp1] >= 1) .. Black Fill

Hope this helps..
s.t.
 
Upvote 0
Swamp Thing said:
Add conditional formatting to fill it in black if your condition is met.
i.e., Condition 1 : "Expression is" ([Comp1] >= 1) .. Black Fill

Forgive my lack of knowledge. I'm doing a lot of database stuff at the moment, and learning more and more as I go.

Where do I add the conditional formatting? (y)
 
Upvote 0
Something that just came to mind.

The default value of Comp1, Comp2.... is blank. Do I need to make the expression ([Comp1] IsNotNull)?
 
Upvote 0
To conditionally format a control, click on it to select, then
Format > Conditional Formatting
from the main menu. (Design View, of course).

You don't need to test for Null values because the "greater than" test for numbers will return "true" only for non-null values.
However, if you did want to test for Non-null values, the condition would have been:

( Not ( IsNull ( [Comp1] ) ) )
 
Upvote 0

Forum statistics

Threads
1,221,581
Messages
6,160,630
Members
451,661
Latest member
hamdan17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top