473,408 Members | 2,839 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,408 software developers and data experts.

Highlight the background color of data on conditions

Ray
I use following event procedure in report but the background colors have no
effect at all but other two formats are ok. Can someone point me out where
I may make a mistake. I am using Access 97.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

If Me.[1] >= 65 Then
Me![1].BackColor = vbGreen
Me![1].ForeColor = vbBlack
Me![1].FontBold = True
ElseIf Me.[1] >= 50 And Me.[1] <= 64 Then
Me![1].BackColor = vbYellow
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

ElseIf Me.[1] >= 0 And Me.[1] <= 49 Then
Me![1].BackColor = vbRed
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

End If

End Sub

Thanks,

Ray
Nov 13 '05 #1
2 1962
On 14 Jul 2004 11:21:51 -0700, Ray wrote:
I use following event procedure in report but the background colors have no
effect at all but other two formats are ok. Can someone point me out where
I may make a mistake. I am using Access 97.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

If Me.[1] >= 65 Then
Me![1].BackColor = vbGreen
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

ElseIf Me.[1] >= 50 And Me.[1] <= 64 Then
Me![1].BackColor = vbYellow
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

ElseIf Me.[1] >= 0 And Me.[1] <= 49 Then
Me![1].BackColor = vbRed
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

End If

End Sub

Thanks,

Ray


1) Use the Detail format event.

2) Make sure the BackStyle property of the control is set to Normal,
not Transparent.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
Ray
Fred,

Thanks for your advice.

Could you please explain in detail why not Detail Print. You second
suggestion works well.

Ray

fredg <fg******@example.invalid> wrote in message news:<ez*****************************@40tude.net>. ..
On 14 Jul 2004 11:21:51 -0700, Ray wrote:
I use following event procedure in report but the background colors have no
effect at all but other two formats are ok. Can someone point me out where
I may make a mistake. I am using Access 97.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

If Me.[1] >= 65 Then
Me![1].BackColor = vbGreen
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

ElseIf Me.[1] >= 50 And Me.[1] <= 64 Then
Me![1].BackColor = vbYellow
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

ElseIf Me.[1] >= 0 And Me.[1] <= 49 Then
Me![1].BackColor = vbRed
Me![1].ForeColor = vbBlack
Me![1].FontBold = True

End If

End Sub

Thanks,

Ray


1) Use the Detail format event.

2) Make sure the BackStyle property of the control is set to Normal,
not Transparent.

Nov 13 '05 #3

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

Similar topics

1
by: john woo | last post by:
Hi I'm not good at JS, but want to get more about it. I want to use a JSP (the java code just used to get date, the rest are html and javascript), to display a table. the requirement is the...
2
by: Dan Schumm | last post by:
I'm relatively new to regular expressions and was looking for some help on a problem that I need to solve. Basically, given an HTML string, I need to highlight certain words within the text of the...
0
by: Chris Fink | last post by:
I am having a problem highlighting a row in a datalist during the itemdatabound event. What is occurring is that a new td row is being wrapped around the datalist item which is highlighted (very...
21
by: listaction | last post by:
Folks, I'm trying to implement a tabbed effect with CSS and HTML - no graphics. for some reason, i'm unable to control the width of the tabs. I've pasted the code below. Any help /...
17
by: toffee | last post by:
Hi all, I have a table with 12 cols and 10 rows. When a user clicks on a table cell; the page is refreshed and displays some data below the table dependant on whichever cell was selected. I...
35
by: shapper | last post by:
Hello, I am creating a search engine which searches keywords inside SQL database and displays the results in a web page. In the results web page I would like to give a grey background to the...
3
by: almurph | last post by:
Hi, I'm a newbie to Javascript. I can;t even finf a full API for it! Anyway I have a table structure and when a user presses the down-arrow button the item in said table is meant to be...
2
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
When you highlight a selection of text represented in an object on a form, somewhere in the Framework or alternatively in the Windows API there exists an array of variables that either contain as a...
0
Merlin1857
by: Merlin1857 | last post by:
A thing I have been asked for on a number of occasions is the ability to highlight text after its been searched for in a record return page. The following does this perfectly. Use this function...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.