By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,640 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,640 IT Pros & Developers. It's quick & easy.

Conditional Formating Expressions

P: n/a
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.
Nov 14 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Nov 14, 4:41*am, gtslabs <gtsl...@comcast.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!MainReport!SubReport1.expr1.fontbold = true
Reports!MainReport!SubReport1.Field1.fontbold = true
Reports!MainReport!SubReport1.Field2.fontbold = true (I put bold here,
but whatever you choose)
Reports!MainReport!SubReport2.Field1.fontbold = true

Else

Reports!MainReport!SubReport1.expr1.fontbold = false
Reports!MainReport!SubReport1.field1.fontbold = false
Reports!MainReport!SubReport1.field2.fontbold = false
Reports!MainReport!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.

Nov 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.