Conditional Formating Expressions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gtslabs

    #1

    Conditional Formating Expressions

    I have a report with 2 subreports
    The first subreport has 3 fields (Expr1, Field1, Field2) Where Expr1
    is a Date
    I want to highlight the 3 fields if a date is within a range of 2
    dates.
    I was able to test the expression using [expr1]<>Now() and that worked
    if I put it in all 3 fields.
    But how do I do that when I am looking at a range of dates?
    I do not have a place yet for these 2 dates but was thinking of 2
    unbound textboxes on my form.

    The second subreport does NOT include the field Expr1 and contains 2
    Fields (Field1_Average and Field2_Average) . If Field1 is highlighted
    in the first subreport I want to highlight Field1_Average also. I am
    not able to but them in the same report.
    I tried using something like [queryx.expr1]<>Now() just to test it but
    it asked for that queryx.expr1 value and I dont want that plus it did
    not work when I entered a date.

    Any help would be apreciated.
  • franc sutherland

    #2
    Re: Conditional Formating Expressions

    On Nov 14, 4:41 am, gtslabs <gtsl...@comcas t.netwrote:
    I have a report with 2 subreports
    The first subreport has 3 fields (Expr1, Field1, Field2) Where Expr1
    is a Date
    I want to highlight the 3 fields if a date is within a range of 2
    dates.
    I was able to test the expression using [expr1]<>Now() and that worked
    if I put it in all 3 fields.
    But how do I do that when I am looking at a range of dates?
    I do not have a place yet for these 2 dates but was thinking of 2
    unbound textboxes on my form.
    >
    The second subreport does NOT include the field Expr1 and contains 2
    Fields (Field1_Average and Field2_Average) .  If Field1 is highlighted
    in the first subreport I want to highlight Field1_Average also.  I am
    not able to but them in the same report.
    I tried using something like [queryx.expr1]<>Now() just to test it but
    it asked for that queryx.expr1 value and I dont want that plus it did
    not work when I entered a date.
    >
    Any help would be apreciated.
    Hi,

    You could use an IF statement.

    ---

    If [expr1] is between [txt_date_1] and [txt_date_2] then

    Reports!MainRep ort!SubReport1. expr1.fontbold = true
    Reports!MainRep ort!SubReport1. Field1.fontbold = true
    Reports!MainRep ort!SubReport1. Field2.fontbold = true (I put bold here,
    but whatever you choose)
    Reports!MainRep ort!SubReport2. Field1.fontbold = true

    Else

    Reports!MainRep ort!SubReport1. expr1.fontbold = false
    Reports!MainRep ort!SubReport1. field1.fontbold = false
    Reports!MainRep ort!SubReport1. field2.fontbold = false
    Reports!MainRep ort!SubReport2. Field1.fontbold = false

    End if

    ---
    You would replace the MainReport, SubReport1 and SubReport2 with the
    names of your report and subreports.
    You could place the if statement in the OnLoad event of the report.

    HTH,

    Franc.

    Comment

    Working...