Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

every second line in a report with grey background

Posted on 2000-02-25
2
Medium Priority
?
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
BrianWren earned 150 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 58
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

597 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