473,394 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.
Nov 14 '08 #1
1 1826
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: neblackcat | last post by:
Would anyone like to comment on the following idea? I was just going to offer it as a new PEP until it was suggested that I post it here for comment & consideration against PEP 308. I'm far...
26
by: Ney André de Mello Zunino | last post by:
Hello. I have noticed, in a lot of C and C++ code, that many programmers seem to prefer putting the test values first in conditional expressions. I.e., they would rather write this: if (-1 ==...
62
by: Reinhold Birkenfeld | last post by:
Hi, after Guido's pronouncement yesterday, in one of the next versions of Python there will be a conditional expression with the following syntax: X if C else Y which is the same as today's...
2
by: rudy | last post by:
I am trying to highlight the output of a field to display something similar to conditional formating. Would prefer to display the result with a code instead of a colored font or colored background...
3
by: Tom | last post by:
Is there any way to use conditional formating to change a control for a field in a continuous form to a textbox, option group or combobox depending on the value of another field on the form? On a...
6
by: Chris Dunaway | last post by:
Consider this code (.Net 2.0) which uses a nullable type: private void button1_Click(object sender, System.EventArgs e) { DateTime? nullableDate; nullableDate = (condition) ? null :...
8
by: Olov Johansson | last post by:
I just found out that JavaScript 1.5 (I tested this with Firefox 1.0.7 and Konqueror 3.5) has support not only for standard function definitions, function expressions (lambdas) and Function...
11
by: volcs0 | last post by:
I've done this in Scheme, but I'm not sure I can in Python. I want the equivalent of this: if a == "yes": answer = "go ahead" else: answer = "stop" in this more compact form:
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
15
by: Nicholas M. Makin | last post by:
I was just thinking that I understood the conditional operator when I coded the following expecting it to fail: int a= 10, b= 20, c= 0; ((a < b) ? a : b) = c; // a=0 a=20; b= 10; ((a < b) ? a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.