473,779 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1850
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.

Nov 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2290
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 from being a "language internist" (on Python or anything else) so go easy on me if this is stupid - it just seemed quite elegant to me as a relative newbie in town :-) I also havent got a clue whether this would be easy or even possible
26
1786
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 == foobar()) than this:
62
3316
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 (Y, X)
2
1645
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 for the sake of using a black and white printer. i.e. if >= 20 then H for highly skilled or >= 15 then S for Skilled Even though the colors work there is only three options to select from under Conditional Formatiting (unless there's a way...
3
1792
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 continuous form, I need some records to have a textbox, some to have an option group and some to have a combobox in the same field. Thanks, Tom
6
12142
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 : DateTime.Now; } When the condition is false, I want to return null. If true, I want to return the current date/time.
8
5113
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 constructors (these three I knew about), but also conditional function definitions, as described in http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Defining_Functions ]. An example: function fun() {
11
5886
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
2115
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. I am very green in this. Please help.
15
1806
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 : b) = c; //b=0 Now since the expresion 5 = c is not valid I did not expect the above to work. But it does work. Why? I thought that the ?: operator would evaluate
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.