Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alternating grey lines (2000 SP3)

    I have searched high and low but no luck. I have a report which has many rows of data. I would like every second row to have a grey background. Bit like (look out showing my age), the old continuous fan fold paper we used when there were still main frames
    Any suggestions
    Steve
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Alternating grey lines (2000 SP3)

    Try this:
    <UL><LI>Open the report in design view.
    <LI>Click on the grey bar at the top of the Detail section, or in an empty part of the Detail section. The caption of the Properties window should now read "Sectionetail".
    <LI>Activate the Event tab of the Properties window.
    <LI>Click in the On Format event.
    <LI>Select [Event Procedure] from the dropdown list.
    <LI>Click the Builder button (the three dots ... to the right of the dropdown arrow.)
    <LI>Make the code look like this:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Static fColor As Boolean
    If fColor Then
    Me.Detail.BackColor = vbWhite
    Else
    Me.Detail.BackColor = vbYellow
    End If
    fColor = Not fColor
    End Sub

    <LI>vbYellow displays as yellow on screen, but yields a pleasant gray on most black-and-white laser printers. If you want gray on screen too, replace vbYellow by something like RGB(224, 224, 224). This is a very light grey. Darker shades tend to be too dark on many printers, but you can experiment.
    <LI>Switch back to Access (Alt+F11) and save the report.[/list]Note: make sure that all text boxes etc. in the detail section have their Back Style set to Transparent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •