A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change BackColor Code Not Working - HELP!



 
 
Thread Tools Display Modes
  #1  
Old December 8th, 2009, 07:56 PM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Change BackColor Code Not Working - HELP!

I have a major request for the Dept of Justice. I have a report that looks
like this:

Task Type 4/5/2010 4/12/2010 4/19/2010
DSR St. Louis St. Louis
Exch RU Seatttle
Exch RU Memphis Memphis Memphis

What I need is code that will work. Basically if Task Type = DSR then the
background color of St. Louis and all other sites with "DSR" attached to it
should be Red. If the Task Type is Exch RU then it'll be Blue, etc.

Please respond quickly.

Thanks

  #2  
Old December 8th, 2009, 08:19 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Change BackColor Code Not Working - HELP!

Your report looks good from here. I am not aware of any issues with the
colors. "Code Not Working" doesn't help us.

Are you using Conditional Formatting? What are your results? If you are
truly using code, then you should share the code.

--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

I have a major request for the Dept of Justice. I have a report that looks
like this:

Task Type 4/5/2010 4/12/2010 4/19/2010
DSR St. Louis St. Louis
Exch RU Seatttle
Exch RU Memphis Memphis Memphis

What I need is code that will work. Basically if Task Type = DSR then the
background color of St. Louis and all other sites with "DSR" attached to it
should be Red. If the Task Type is Exch RU then it'll be Blue, etc.

Please respond quickly.

Thanks

  #3  
Old December 8th, 2009, 09:18 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Change BackColor Code Not Working - HELP!

Ben wrote:

I have a major request for the Dept of Justice. I have a report that looks
like this:

Task Type 4/5/2010 4/12/2010 4/19/2010
DSR St. Louis St. Louis
Exch RU Seatttle
Exch RU Memphis Memphis Memphis

What I need is code that will work. Basically if Task Type = DSR then the
background color of St. Louis and all other sites with "DSR" attached to it
should be Red. If the Task Type is Exch RU then it'll be Blue, etc.



You can use some code in the Format (or Print) event to do
that:

Select Case Me.[Task Type]
Case "DSR"
Me.Section(0).BackColor = vbRed
Case "Exch RU"
Me.Section(0).BackColor = vbBlue
Case ?
. . .
Case Else
MsgBox "Unknown task type"
End Select

You will probably want to make each of the text box's
BackStyle property to Transparent.

At some point, you will probably have to change a color or
even add a new task type so it might be worth investing some
time to remove the code's dependency on the task type. That
would be done by adding a color code field to the table that
defines the available task types.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.