[AccessD] report detail - conditional formatting

John Bartow john at winhaven.net
Sun Jul 24 11:08:34 CDT 2011


Thanks all. I'll follow these suggestions and post back if I have any follow
ups.

(I've been formatting with PhP lately so I needed a thought refresher on
Access Report formatting.)
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bob Gajewski
Sent: Saturday, July 23, 2011 10:33 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] report detail - conditional formatting

Hi John

You can do just about anything with formatting in the Detail section ...
Here are some examples:

The "Detail_Print" code makes every other line grey ... Kind of a green-bar
paper effect.

The "Detail_Format" section checks the value of a field, and if it matches a
set value, then a colored textbox become visible behind the other fields ...
Else is remains hidden. You can control font formatting the same way ...
Bold, italic, underline, etc.

Regards,
Bob Gajewski

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) Const
conLtGray = 13816530 If Detail.BackColor = conLtGray Then
    Detail.BackColor = vbWhite
Else
    Detail.BackColor = conLtGray
End If
End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If
Me.CardexStreetSide = "(intersection)" Then
    If Me.CardexIntersectingStreetID = 327 Then
        Me.txtIntersectionHighlight = ""
        Me.txtIntersectionHighlight.Visible = False
        Me.txtBridgeOverCreekHighlight = " "
        Me.txtBridgeOverCreekHighlight.Visible = True
    Else
        Me.txtIntersectionHighlight = " "
        Me.txtIntersectionHighlight.Visible = True
        Me.txtBridgeOverCreekHighlight = ""
        Me.txtBridgeOverCreekHighlight.Visible = False
    End If
    Me.SectorNumber.Visible = False
    Me.txtCoordinates.Visible = True
Else
    Me.Occupant = Me.Occupant
    Me.txtIntersectionHighlight = ""
    Me.txtIntersectionHighlight.Visible = False
    Me.txtBridgeOverCreekHighlight = ""
    Me.txtBridgeOverCreekHighlight.Visible = False
    Me.SectorNumber.Visible = True
    Me.txtCoordinates.Visible = False
End If
End Sub 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Bartow
Sent: Saturday, July 23, 2011 12:09 PM
To: DBA-Access
Subject: [AccessD] report detail - conditional formatting

Is it possible to create conditional formatting per detail line in an Access
report?

I would like to have certain items print in bold.

TIA
John B

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list