Solved

every second line in a report with grey background

Posted on 2000-02-25
2
274 Views
Last Modified: 2012-08-13
I do have a report with a lot of data. To get a proper view on this, I would like to have every second line with a grey background. How to do??
0
Comment
Question by:Kongta
2 Comments
 
LVL 9

Accepted Solution

by:
BrianWren earned 50 total points
ID: 2559648
Set up a global variable in a module that will be toggled on and off, Say:

Public rptBkGnd As Boolean

In the report detail On Format Event put:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

     Select Case rptBkGnd
          Case True
               Me.Section(0).BackColor = 16777215 ' White
               rptBkGnd = False
          Case False
               Me.Section(0).BackColor = 12632256 ' Gray
               rptBkGnd = True
     End Case

End Sub

Brian
0
 
LVL 57
ID: 2559759
Just one additonal note to Brian's suggestion.  OnFormat can get fired off multiple times if Access retreats up the page, so wrap the code he gave you in a check like this:


  If FormatCount = 1 then
   'Brian's code here
  End If

  This way, your background color will only toggle once.

Jim
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now