473,472 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

automaticaly change a part of expression in a number of a report's control values

1 New Member
#1 in my report i need to group my clients and print a color code "Green", "Red" and "Blue" above names of the clients depending on values in the order form. Is it possible to print it from the single textbox (right now I have 3 textboxes with
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=1, "Green")
in first one.
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=2, "Red")
in second box etc. Which makes printout look very bad.

#2 On a report i have a few textboxes that get data based on "count function"
Expand|Select|Wrap|Line Numbers
  1. =Count([Day1])
or "if statments"
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=1, "Green")
where "Day1" is a field in a query. This field represents a day of a month. And for dayly report i have to change it every day replacing "Day1" with "Day2" etc in 5 textboxes.
How can I automate changing these field names inside functions and "if" statements.
Dec 28 '06 #1
2 1455
NeoPa
32,556 Recognized Expert Moderator MVP
Pripa - try reposting the questions but remember we don't know anything until you tell us. Read through the question before you hit submit and see if it makes sense to you. If not, then we, who don't know what happens in your database, will be even more confused.

MODERATOR.
Dec 30 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
#1 in my report i need to group my clients and print a color code "Green", "Red" and "Blue" above names of the clients depending on values in the order form. Is it possible to print it from the single textbox (right now I have 3 textboxes with
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=1, "Green")
in first one.
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=2, "Red")
in second box etc.
Which makes printout look very bad.
Try this ...

Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=1, "Green",IIf([Day1]=2, "Red", IIf([Day1]=3, "Blue")))
  2.  
#2 On a report i have a few textboxes that get data based on "count function"
Expand|Select|Wrap|Line Numbers
  1. =Count([Day1])
or "if statments"
Expand|Select|Wrap|Line Numbers
  1. =IIf([Day1]=1, "Green")
where "Day1" is a field in a query.
This field represents a day of a month. And for dayly report i have to change it every day replacing "Day1" with "Day2" etc in 5 textboxes.
How can I automate changing these field names inside functions and "if" statements.
Have an invisible textbox on the report called dayNum and set control source to
=[Enter Day Num:]
this will prompt you to enter the day number when the report opens

Now all these textbox control source expressions will have to be set using vba in the reports on format event

Expand|Select|Wrap|Line Numbers
  1. Me.textboxName.ControlSource = "=IIf([Day & Me.dayNum & "]=1, "Green",IIf([Day & Me.dayNum & "]=2, "Red", IIf([Day & Me.dayNum & "]=3, "Blue")))

And so on ....

Mary
Jan 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Sam Fisher | last post by:
Hi, I have a crystal reports hosted on the IIS as web service. Everything works fine except that I can not access the database other than the one on which the report originally created. I am...
3
by: Ken Bush | last post by:
How can I write an update query that removes part of a field? Like if I have a field with values such as 8/3/68 (a birthday obviously) and I need to put values in a new column but I need...
5
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is...
3
by: X_HOBBES | last post by:
I'm fairly new to Access, let alone Expression Builder. However, it seems that I'm either doing something really wrong or Access is really stupid! I can't reference fields that show up on my...
7
by: Csaba Gabor | last post by:
I feel like it's the twilight zone here as several seemingly trivial questions are bugging me. The first of the following three lines is a syntax error, while the last one is the only one that...
11
by: Steve | last post by:
Hi All, I'm having a tough time converting the following regex.compile patterns into the new re.compile format. There is also a differences in the regsub.sub() vs. re.sub() Could anyone lend...
4
by: Henrootje | last post by:
I have a REPORT with in it a subFORM Now I have this label (lblMonth) that I want to change. How should I do this? What would be the proper event to do this? The lblMonth should contain the...
15
by: Bernice J | last post by:
I'm trying to count the number of records in a table with the field STATUS that have a Y value. I'm using the expression "=Count(IIf(="Y",1,0))" . It counts all the values not just the Y's. Any...
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
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,...
0
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...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.