Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Conditional Formatting in Report


Message #1 by "NAME REMOVED (Ext. 816)" <EMAIL REMOVED> on Thu, 29 Aug 2002 15:47:04 +0100
Hi all,
Is it possible to format a field in a report based on it's value. E.G. if
it's value is greater than 100 it will appear red.

Thanks in advance.

NAME REMOVED


**************************************************************************
The information contained in this e-mail is confidential,
may be privileged and is intended only for the use of the
recipient named above. If you are not the intended
recipient or a representative of the intended recipient,
you have received this e-mail in error and must not copy,
use or disclose the contents of this email to anybody
else. If you have received this e-mail in error, please
notify the sender immediately by return e-mail and
permanently delete the copy you received. This email has
been swept for computer viruses. However, you should
carry out your own virus checks.


Registered in Ireland, No. 205721. http://www.FINEOS.com
**************************************************************************

Message #2 by "Gerald, Rand" <RGerald@u...> on Thu, 29 Aug 2002 09:54:34 -0500
Dear NAME REMOVED,

Yes it is possible. I do it all the time.  You will need to execute VBA 
code
in the detail section of the report.  You execute conditionals in the 
code
based upon field values and set the field object properties.

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: NAME REMOVED (Ext. 816) [mailto:NAME REMOVED.Mulvany@f...]
Sent: Thursday, August 29, 2002 9:47 AM
To: Access
Subject: [access] Conditional Formatting in Report

Hi all,
Is it possible to format a field in a report based on it's value. E.G. 
if
it's value is greater than 100 it will appear red.

Thanks in advance.

NAME REMOVED


************************************************************************
**
The information contained in this e-mail is confidential,
may be privileged and is intended only for the use of the
recipient named above. If you are not the intended
recipient or a representative of the intended recipient,
you have received this e-mail in error and must not copy,
use or disclose the contents of this email to anybody
else. If you have received this e-mail in error, please
notify the sender immediately by return e-mail and
permanently delete the copy you received. This email has
been swept for computer viruses. However, you should
carry out your own virus checks.


Registered in Ireland, No. 205721. http://www.FINEOS.com
************************************************************************
**


Message #3 by "Foote, Chris" <Chris.Foote@u...> on Thu, 29 Aug 2002 16:28:28 +0100
Hi NAME REMOVED!

Yes indeed it is!

I use the code below in one of my Reports to do a similar thing:

=========Code start==============
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.Fail5Y.Value > 1 Then
    Me.Fail5Y.ForeColor = vbRed
Else
    Me.Fail5Y.ForeColor = vbBlack
End If

End Sub
============Code end=================

You will need to repeat the If/Else/End If code for each field.

HTH - Spike


> -----Original Message-----
> From: NAME REMOVED (Ext. 816) [mailto:NAME REMOVED.Mulvany@f...]
> Sent: Thursday, August 29, 2002 3:47 PM
> To: Access
> Subject: [access] Conditional Formatting in Report
> 
> 
> Hi all,
> Is it possible to format a field in a report based on it's 
> value. E.G. if
> it's value is greater than 100 it will appear red.
> 
> Thanks in advance.
> 
> NAME REMOVED
> 
> 
> **************************************************************
> ************
> The information contained in this e-mail is confidential,
> may be privileged and is intended only for the use of the
> recipient named above. If you are not the intended
> recipient or a representative of the intended recipient,
> you have received this e-mail in error and must not copy,
> use or disclose the contents of this email to anybody
> else. If you have received this e-mail in error, please
> notify the sender immediately by return e-mail and
> permanently delete the copy you received. This email has
> been swept for computer viruses. However, you should
> carry out your own virus checks.
> 
> 
> Registered in Ireland, No. 205721. http://www.FINEOS.com
> **************************************************************
> ************
> 
> 
> 
Message #4 by "Joseph O. Makong'ong'o" <jom@s...> on Fri, 30 Aug 2002 08:41:34 +0300
Dear Gerand,

Ps. Can you put some sample code here.--JM

> -----Original Message-----
> From:	Gerald, Rand [SMTP:RGerald@u...]
> Sent:	Thursday, August 29, 2002 5:55 PM
> To:	Access
> Subject:	[access] RE: Conditional Formatting in Report
> Importance:	High
>
> Dear NAME REMOVED,
>
> Yes it is possible. I do it all the time.  You will need to execute 
VBA
> code
> in the detail section of the report.  You execute conditionals in the 
code
> based upon field values and set the field object properties.
>
> Rand E Gerald
> Database Specialist
> Information Services / Operations
> Bah=E1'=ED National Office
> 1233 Central St.
> Evanston IL 60201
> (xxx) xxx-xxxx
>
> -----Original Message-----
> From: NAME REMOVED (Ext. 816) [mailto:NAME REMOVED.Mulvany@f...]
> Sent: Thursday, August 29, 2002 9:47 AM
> To: Access
> Subject: [access] Conditional Formatting in Report
>
> Hi all,
> Is it possible to format a field in a report based on it's value. 
E.G. if
> it's value is greater than 100 it will appear red.
>
> Thanks in advance.
>
> NAME REMOVED
>
>
> 
************************************************************************
**
> The information contained in this e-mail is confidential,
> may be privileged and is intended only for the use of the
> recipient named above. If you are not the intended
> recipient or a representative of the intended recipient,
> you have received this e-mail in error and must not copy,
> use or disclose the contents of this email to anybody
> else. If you have received this e-mail in error, please
> notify the sender immediately by return e-mail and
> permanently delete the copy you received. This email has
> been swept for computer viruses. However, you should
> carry out your own virus checks.
>
>
> Registered in Ireland, No. 205721. http://www.FINEOS.com
> 
************************************************************************
**
>
>
>
Message #5 by "Gerald, Rand" <RGerald@u...> on Fri, 30 Aug 2002 10:28:41 -0500
Hi Joseph,

Try something like this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Year(MyDate) < 2002 Then
        MyDate.Properties.Item("ForeColor") =3D vbRed
    Else
        MyDate.Properties.Item("ForeColor") =3D vbBlack
    End If
End Sub

MyDate is a Date field on the report.

Good luck,

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: Joseph O. Makong'ong'o [mailto:jom@s...]
Sent: Friday, August 30, 2002 12:42 AM
To: Access
Subject: [access] RE: Conditional Formatting in Report

Dear Gerand,

Ps. Can you put some sample code here.--JM

> -----Original Message-----
> From: Gerald, Rand [SMTP:RGerald@u...]
> Sent: Thursday, August 29, 2002 5:55 PM
> To:   Access
> Subject:      [access] RE: Conditional Formatting in Report
> Importance:   High
>
> Dear NAME REMOVED,
>
> Yes it is possible. I do it all the time.  You will need to execute 
VBA
> code
> in the detail section of the report.  You execute conditionals in the 
code
> based upon field values and set the field object properties.
>
> Rand E Gerald
> Database Specialist
> Information Services / Operations
> Bah=E1'=ED National Office
> 1233 Central St.
> Evanston IL 60201
> (xxx) xxx-xxxx
>
> -----Original Message-----
> From: NAME REMOVED (Ext. 816) [mailto:NAME REMOVED.Mulvany@f...]
> Sent: Thursday, August 29, 2002 9:47 AM
> To: Access
> Subject: [access] Conditional Formatting in Report
>
> Hi all,
> Is it possible to format a field in a report based on it's value. 
E.G. if
> it's value is greater than 100 it will appear red.
>
> Thanks in advance.
>
> NAME REMOVED
>
>
> 
************************************************************************
**
> The information contained in this e-mail is confidential,
> may be privileged and is intended only for the use of the
> recipient named above. If you are not the intended
> recipient or a representative of the intended recipient,
> you have received this e-mail in error and must not copy,
> use or disclose the contents of this email to anybody
> else. If you have received this e-mail in error, please
> notify the sender immediately by return e-mail and
> permanently delete the copy you received. This email has
> been swept for computer viruses. However, you should
> carry out your own virus checks.
>
>
> Registered in Ireland, No. 205721. http://www.FINEOS.com
> 
************************************************************************
**
>
>
>


  Return to Index