?
Solved

Conditional Formatting in Access 2007

Posted on 2009-05-08
4
Medium Priority
?
630 Views
Last Modified: 2012-05-06
I have a report control that i need to format based on the value of the control.  This control will always have greater than 3 values that need to be formatted so i am trying to figure out how to apply this link to a report since it seems to be aimed at a form that will only show one of the formats at once (although as i stated, in my report there will always be the case where 4-6 colors will be necessary on the one control).  Can someone help me, 1) apply the below to a report and 2) apply the more than 4 conditions.

http://msdn.microsoft.com/en-us/library/aa139965(office.10).aspx
0
Comment
Question by:oralb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Michael Vasilevsky earned 1000 total points
ID: 24338355
I think the easiest thing to do is just add some VBA in the Report_Activate event. I think formatting has to be done on Report_Activate, not Report_Open or Report_Load, but I could be wrong about that. Something like the below.


Private Sub Report_Activate()
 
     Select Case Me!MyReportControl
           Case is <3
                Me!MyReportControl.Backcolor=#ED1C24 'red
           Case is 4
                Me!MyReportControl.Backcolor=#FFC20E 'orange
           Case is =5
                Me!MyReportControl.Backcolor=#FFF200 'yellow
           Case is >5
                Me!MyReportControl.Backcolor=#22B14C 'green
     end select
End Sub

Open in new window

0
 
LVL 7

Expert Comment

by:shambalad
ID: 24339623
You don't really need to use conditional formatting in reports. Reports are similar to continuous forms with one big difference. In reports, you have 'Detail_Format' sub wherein you can set the properties of any text box in the row to anything you want. You can change the font for the textbox for that row to whatever you want. Bear in mind that if you do not change that property when the 'Detail_Format' sub  runs for the subsequent line, it will retain whatever property setting you had set previous. For instance, let's say you set the font weight to Bold for one line for whatever reason. If you do not change the font weight back to Normal for the next line, the text will continue to be bold.
See attached for more illustration of the concept.
Todd
0
 
LVL 7

Assisted Solution

by:shambalad
shambalad earned 1000 total points
ID: 24339629
Here's the file.
Todd
FormatReportControls.mdb
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question