Solved

every second line in a report with grey background

Posted on 2000-02-25
2
259 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

708 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

15 Experts available now in Live!

Get 1:1 Help Now