PC Review


Reply
Thread Tools Rate Thread

Conditional format in a report

 
 
CGo
Guest
Posts: n/a
 
      28th Jul 2009
In office 07; I'm trying to format a field in a report. I can change the
color of the text depending if the order is late or due within the next 30
days. What I am trying to do is change the background of the due date column
depending on what quarter it falls in. I've tried just typing in the date
but that doesn't seem to work. Any suggestions??

Thanks
Chris
 
Reply With Quote
 
 
 
 
Al Campagna
Guest
Posts: n/a
 
      28th Jul 2009
CGo,
Using Conditional Formatting against a date field named DOC...
Month([DOC]) In (1,2,3)
This would allow a color selection for any date within the first
quarter.
Month([DOC]) In (4,5,6)
For second quarter...
Month([DOC]) In (7,8,9)
For third quarter

Most folks think there are only 3 conditions allowed in conditional
formatting, but logically there are 4.
If a Month(date) is not any of the above, use the Default Formatting
color to represent the fourth quarter.

Also, because this is a report, you can use the OnFormat event
of your date control's report section to color the date field background.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Month(DOC) = 1 Or Month(DOC) = 2 Or Month(DOC) = 3 Then
DOC.BackColor = QBColor(14)
ElseIf Month(DOC) = 4 Or Month(DOC) = 5 Or Month(DOC) = 6 Then
DOC.BackColor = QBColor(11)
' etc etc for all 4 quarters
End If
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"CGo" <(E-Mail Removed)> wrote in message
news:4A4B60E2-8668-43ED-A36F-(E-Mail Removed)...
> In office 07; I'm trying to format a field in a report. I can change the
> color of the text depending if the order is late or due within the next 30
> days. What I am trying to do is change the background of the due date
> column
> depending on what quarter it falls in. I've tried just typing in the date
> but that doesn't seem to work. Any suggestions??
>
> Thanks
> Chris



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Format for Report =?Utf-8?B?Q2FybGFJbkpheA==?= Microsoft Access Reports 10 24th Sep 2007 11:02 PM
Conditional format in a report Martin Hopkins Microsoft Access Reports 1 29th May 2006 01:31 AM
Conditional Format in Report Using VBA =?Utf-8?B?Um9iU29s?= Microsoft Access VBA Modules 9 17th Mar 2006 03:19 PM
Re: Conditional Format in a Report Marshall Barton Microsoft Access Reports 0 5th Dec 2005 04:39 AM
Conditional format in a report Conditional format Microsoft Access Reports 1 20th Feb 2004 01:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.