473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Access 2007 - Report Shading

133 100+
Contained within a 2007 database, a report has VBA code for detailed line shading as shown below. However, when a macro executes open report command, the shading does not appear. But appears when printed.

Any suggestions would be appreciated.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private shadeNextRow As Boolean
  5. Const shadedColor = 12632256
  6. ' Const shadedColor = 15726583 ' alternative shade colors
  7. ' Const shadedColor = 14078404
  8. ' Const shadedColor = 13356495
  9. ' Const shadedColor = 14281974
  10. Const normalColor = 16777215
  11.  
  12. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  13.  
  14.   On Error GoTo Detail_Format_Error
  15.  
  16. ' Choose a color based on the shadeNextRow value
  17.   If shadeNextRow = True Then
  18.     Me.Section(acDetail).BackColor = shadedColor
  19.   Else
  20.     Me.Section(acDetail).BackColor = normalColor
  21.   End If
  22.  
  23. ' Switch the color for the next row
  24.   shadeNextRow = Not shadeNextRow
  25.  
  26. Detail_Format_Exit:
  27.   Exit Sub
  28.  
May 13 '10 #1
1 2499
dowlingm815
133 100+
Got it, the macro needs to specific print preview.
May 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no...
2
by: Suzanne801 | last post by:
Hi, I am new to VB and trying to get Excel output from Access 2007-Report using: DoCmd.OutputTo acOutputReport, rptName, acFormatXLSX, OFileName, True I keep on getting: Run-time error...
1
by: sjivanjee | last post by:
Help In Access 2007 - Report (Grouping and Sub Totaling) I have two table one stores student information and other one is for their attendance. In the attendance table their is a field called...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
by: cowboyjunkey | last post by:
This is what I want to do: Each report page will list some details about a sample (like time sampled, where, who sampled) and below it a chart showing the distribution of the sample (i.e....
3
by: riaane | last post by:
Please help. This is driving me around the bend. I have a report that I OutputTo Rich Text format but my Percentage calculations do not survive the conversion from the report to the saved...
2
tuxalot
by: tuxalot | last post by:
Vertical date on my report shows ####### Other vertical text appears correct.....hmmmm ideas?
4
by: riaane | last post by:
Please help: I have Conditional Formatting on a Report Field that fills the background Red if the criteria is met. This displays correctly in Report View, however, when I "OutputTo" this report to...
1
by: mrzebo1 | last post by:
I have an access 2007 report that I an executing from a form, The report is based on a query that i change when it is execuded using me.recordsource=, There is a text box in the heading that i want...
2
by: Steve Chapman | last post by:
Is there a way to unlink the field title from the field so they can have different lengths? When I adjust the width of either one, the other changes also. I have looked through the property sheet...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.