473,491 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Change color of text box when printing report

Hi,

Im trying to change the color of a text box on a report that im printing
from a form.

On the form I got a check box that has to tricker the color of that textbox
on the printed report.
If checked color is red else just black.

But I dont know how to do it.

I think I have to put the string in the open event of the report, but I have
tried some things, but I only get errors :)

Please help me...
Xiphias
Nov 12 '05 #1
2 3884
On Sun, 18 Jan 2004 00:37:29 +0100, "Xiphias" <Am*******@yahoo.com>
wrote:
Hi,

Im trying to change the color of a text box on a report that im printing
from a form.

On the form I got a check box that has to tricker the color of that textbox
on the printed report.
If checked color is red else just black.

But I dont know how to do it.

I think I have to put the string in the open event of the report, but I have
tried some things, but I only get errors :)

Please help me...
Xiphias


You haven't said whether or not the Check Box on the form is part of
the recordsource of the report.

If the Check Box is included in the Report's recordsource...
To change the color of a control when certain criteria is met, code
the Format event of the section the control is in, probably in your
case, the Detail section.

If [CheckBoxName] = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If

If the Check Box is not included in the reports recordsource:

If forms!FormName!CheckBoxName = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If

The Form must be open when the report is run.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
Nov 12 '05 #2
Thanx this must do perfect...!!

Ps. the check box is also on the report.

Greetings,
Paul
<fr***@example.invalid> schreef in bericht
news:14********************************@4ax.com...
On Sun, 18 Jan 2004 00:37:29 +0100, "Xiphias" <Am*******@yahoo.com>
wrote:
Hi,

Im trying to change the color of a text box on a report that im printing
from a form.

On the form I got a check box that has to tricker the color of that textboxon the printed report.
If checked color is red else just black.

But I dont know how to do it.

I think I have to put the string in the open event of the report, but I havetried some things, but I only get errors :)

Please help me...
Xiphias


You haven't said whether or not the Check Box on the form is part of
the recordsource of the report.

If the Check Box is included in the Report's recordsource...
To change the color of a control when certain criteria is met, code
the Format event of the section the control is in, probably in your
case, the Detail section.

If [CheckBoxName] = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If

If the Check Box is not included in the reports recordsource:

If forms!FormName!CheckBoxName = -1 Then
[Controlname].ForeColor = vbRed
Else
[ControlName].ForeColor = vbBlack
End If

The Form must be open when the report is run.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.

Nov 12 '05 #3

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

Similar topics

7
14689
by: Don Seckler | last post by:
I have a database that is going to be used to do billing on orders. I sent up a field for each record that is called Billed and is a yes/no field. I want to do a query that will pull all the...
2
4486
by: neill dumont | last post by:
I've tried to be clear, but this still seems overly complex to me, but here goes: I have a report in front of an aggregate query. I have a single subreport based on the same query for both a...
5
12701
by: Steve | last post by:
I need a way to programatically change the width of a textbox to display all the data knowing the font, font size and number of characters. Does any oone know of a reference somewhere ot a way to...
7
20663
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
11
2796
alpnz
by: alpnz | last post by:
Hi, I am sure someone has managed this one before. I have a report, which I call from a button on a form, which invokes the printing of 4 copies of a report. I would like to have a box on the...
4
5855
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...
11
7431
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
2
1431
by: mahesh123 | last post by:
Hi Folks, I am generating the text reports from the visual basic 6.0. while printing the text report the Char(12) ie page break character is not recognising. Is there any alternate Solution for...
0
1409
by: Deceneu | last post by:
Hi everyone, this is my first post so please bear with me. I have the following situation: i have a local report that needs to have two "versions": one for viewing in the report viewer (with all...
0
7115
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
6978
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
7154
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,...
1
6858
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
7360
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...
0
5451
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,...
0
4578
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
3086
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
280
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...

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.