Advertisement

05.09.2008 at 11:28AM PDT, ID: 23390408
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Programming Conditional Formatting for Coloring a Report
Tags: microsoft, Access, 2003
I have a one page report that prints out all the people in a phone number list. The list is made up of a query. The report groups the entries by location. There are 6 different locations, and what I'm trying to do is based on the person's location, thier information would show up on the report in a different color. Basically Location 1 background box is orange and the people in Location1 would have orange text. Location2 background box is blue, and the people in location 2 would show up in Blue text. etc Still learning alot about Access and coding in Access hopefully this is not too hairy
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: afsfire
Solution Provided By: matthewspatrick
Participating Experts: 2
Solution Grade: A
Views: 5
Translate:
Loading Advertisement...
05.09.2008 at 11:34AM PDT, ID: 21535391

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 11:56AM PDT, ID: 21535544

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 12:00PM PDT, ID: 21535580

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 12:53PM PDT, ID: 21535949

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 01:00PM PDT, ID: 21536001

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 01:48PM PDT, ID: 21536317

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 02:05PM PDT, ID: 21536401

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 05:35PM PDT, ID: 21537347

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.09.2008 at 11:34AM PDT, ID: 21535391

Rank: Genius

Conditional Formatting ... ok, follow these steps:

Open your form in design view
Select the control you want to format
From the menu bar .... Format>>Conditional Formatting ...
Set 'Condition 1' to Expression Is
In the text box to the right of Condition 1, enter this:

<some expression?

Then, use the color pickers to set the ForeColor to the same color as what ever background color you now have on

Finally ... on the far right is one more option ... a square box ... which you can set to Enable or Disable the control. Click that option ... and you will see right there that the Preview is grayed out. COOL !!!

Click OK.

If we've done this correctly ... any row wherein that condition has been met ... the ForeColor should be the same as the BackColor ... thus effectively making it seem 'invisible' ... sort of.  IE ... you won't see any text in the box.

mx
---------------------------

Ok ... here is the basic info

First ... a short tutortial
http://www.simply-access.com/ConditionalFormattingIntroduction.html

In VBA code:

http://msdn2.microsoft.com/en-us/library/aa139965(office.10).aspx

http://support.microsoft.com/kb/304104 .

--------------------------
 
05.09.2008 at 11:56AM PDT, ID: 21535544
I have looked at the conditional formatting and i don't know if it is going to be sufficient enough to do what I'm trying to do... Although I'm not particularly sure of that. I basically had all of the data in Excel at one time. Since I have brought it into access i wanted to print out a form that resembled the Excel Spread sheet. If you look at the example.xls attached here you can see what I mean. I have the form looking the way i want except for the coloring. Wiill the conditional formatting acheive this or will I need to use code to do this? Also when I try to do antything in conditional formatting, the field on the report just says #Name? even if I just change the color of the background... one last thing when you listed above <some expression? should it literally say some expression or should it actually have an expression there?
 
05.09.2008 at 12:00PM PDT, ID: 21535580
Oh here is the Example.xls file
 
Example of what I'm going for in my report
 
 
05.09.2008 at 12:53PM PDT, ID: 21535949

Rank: Genius

Try this, run from Excel:

Sub ColorThem()

    Dim LastR As Long
    Dim UseColor As Long
    Dim Counter As Long
    Dim Test As String
   
    LastR = Cells(Rows.Count, 1).End(xlUp).Row
   
    For Counter = 1 To LastR
        Test = Cells(Counter, 1)
        If Test <> "" And Not IsNumeric(Test) Then
            UseColor = Cells(Counter, 1).Interior.ColorIndex
        ElseIf IsNumeric(Test) Then
            Cells(Counter, 2).Resize(1, 3).Font.ColorIndex = UseColor
        End If
    Next
   
    MsgBox "Done"
   
End Sub
 
05.09.2008 at 01:00PM PDT, ID: 21536001
Did you say run from Excel?

I'm trying to create this report in Access, The excel file is just an example of how I wanted the report in access to look as far as the coloring. Unless I'm missing something?
 
05.09.2008 at 01:48PM PDT, ID: 21536317

Rank: Genius

afsfire,

It would be useful to see some sample data.  EE now allows you to directly
upload files to your question.

Please be advised that once you upload a file, it can be publicly accessed,
and that it may not be possible to fully and permanently delete it.  Therefore,
be very careful about posting proprietary, confidential, or other sensitive
information.  If necessary, use "fake" and/or obfuscated data in your
sample.

Regards,

Patrick
 
05.09.2008 at 02:05PM PDT, ID: 21536401
Here is a copy with all of the records changed to generic values
 
Temp DB
 
 
05.09.2008 at 05:35PM PDT, ID: 21537347

Rank: Genius

afsfire,

I did the following with your sample db...

1) Modified tblLocation to include a new column, Color, defined as Long

2) Put in 65280 as the vaue in Color for AZ, and zero for the others

3) Modified qrySortBYLocation to include that new Color column

4) Added Color as a field to the Detail section of the report, and set the Visible property to False (no)

5) Added the following code to that report:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

    Dim txt As Control
   
    Set txt = Me.Telephone__
    txt.ForeColor = [Color]
    Set txt = Me.Radio_ID
    txt.ForeColor = [Color]
    Set txt = Me.Type
    txt.ForeColor = [Color]
    Set txt = Me.Access
    txt.ForeColor = [Color]
   
End Sub

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)

    Dim txt As TextBox
   
    Set txt = Me.Location
   
    txt.BackColor = [Color]
   
End Sub

That appears to have worked.  You will need to update the color values in tblLocation as needed.

Regards,

Patrick
Accepted Solution
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628