Hello All,
I have a report where it lista employees that need to have an eval done in the next 30 days.
If the employee has a 3 month, 6 month or 12 month eval due in the next 30 days it lists the employee name, 3 month eval due date, 3 month eval score, 6 month eval due date, 6 month eval score, and 12 month eval due date and score. I would like the report to bold or highlight either the 3, 6 or 12 month eval due date that made teh ee hit the report criteria, and I cannot seem to get to to work ... So for each ee in the list one of the due dates would be in BOLD or have a red background... (Which i have tried in the ON Open event of the form.
here is my code... - Private Sub Report_Open(Cancel As Integer)
-
Dim strDivision As String
-
Dim strTerm As String
-
Dim strEmpType As String
-
Dim dteCurrentdate As Date
-
-
'Open the form to get the variables
-
DoCmd.OpenForm "SelectReportCriteriaEval", acNorman, , , , acDialog
-
-
' Get the Seleceted Values
-
strDivision = Nz(Forms("SelectReportCriteriaEval")!selDivision, " ")
-
strTerm = "N"
-
strEmpType = "Temp"
-
dteCurrentdate = DateAdd("m", 1, Date)
-
'MsgBox "strDivision = " & strDivision
-
-
' Set the recordsource for the report
-
If strDivision <> "ALL" Then
-
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
-
"WHERE Division = '" & strDivision & "' " & _
-
"AND EmpType LIKE '[" & strEmpType & "]*' " & _
-
"AND Terminated Like '" & strTerm & "' " & _
-
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreFlag = 'N') OR " & _
-
"(The6MEvalDate <= #" & dteCurrentdate & "# AND The6MEvalScoreFlag = 'N') OR " & _
-
"(The12MEvalDate <= #" & dteCurrentdate & "# AND The12MEvalScoreFlag = 'N'))"
-
Else
-
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
-
"WHERE EmpType LIKE '[" & strEmpType & "]*' " & _
-
"AND Terminated Like '" & strTerm & "' " & _
-
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreFlag = 'N') OR " & _
-
"(The6MEvalDate <= #" & dteCurrentdate & "# AND The6MEvalScoreFlag = 'N') OR " & _
-
"(The12MEvalDate <= #" & dteCurrentdate & "# AND The12MEvalScoreFlag = 'N'))"
-
-
End If
-
-
'MsgBox "Me.RecordSource = " & Me.RecordSource
-
-
' MsgBox "Me.Date = " & FThe3MEvalDate
-
-
' MsgBox "Me.Date = " & dteCurrentdate
-
-
If The3MEvalDate <= dteCurrentdate Then
-
If The3MEvalScoreFlag = "N" Then
-
Me.FThe3MEvalDate.BackColor = "RED"
-
End If
-
End If
-
If The6MEvalDate <= dteCurrentdate Then
-
If The6MEvalScoreFlag = "N" Then
-
Me.FThe6MEvalDate.BackColor = "RED"
-
End If
-
End If
-
If The12MEvalDate <= dteCurrentdate Then
-
If The12MEvalScoreFlag = "N" Then
-
Me.FThe12MEvalDate.BackColor = "RED"
-
End If
-
End If
-
-
DoCmd.Close acForm, "SelectReportCriteriaEval"
-
End Sub
Any help would be greatly appreciated... I am sure I ma just putting this in the wrong event or somethign but It is Friday and my head hurts so I am posting as a last resort!
THANK YOU!
6 2821
Assuming you're running ACC2000 or later, you can do this using Conditional Formatting, just like you would in a form.
Linq ;0)> mshmyob 904
Recognized Expert Contributor
Linq's suggestion is easiest and I would also recommend it but if you still want to code it try the following: -
Dim vRed as Long
-
vRed RGB(255,0,0)
-
Me!txtControl.BackColor = vRed
-
If you still need to apply bold to a control the hard way without using conditional formatting or setting the background place an expression like this in the on-format event of the section of your report in which the controls you need to highlight are placed: - If (condition you are testing) then
-
Me.[name of the control you want to embolden].Fontbold = True
-
else
-
Me.[name of the control you want to embolden].Fontbold = False
-
Endif
-
If your condition is easily readable and understandable you could shorten this to -
-
Me.[name of the control you want to embolden].Fontbold = (condition you are testing)
-
-Stewart
Thanks to all! (I have had the flu and just now gettign back to work)
Glad we could help! Hope you're feeling better!
Linq ;0)>
Bold-ing a control will make all the text in the control bold, or the color specified. If you are interested in only making one word in a multi-word string bold or a different color, there is a module that I found somewhere and use quite a bit that does just this. If you're interested in it, let me know and I'll dig it out, polish it up and post it :-)
Regards,
Scott
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Holliingsworth |
last post by:
Hello:
Thanks for reading this post.
I need to create a metrics (form or report - I don't care which) to
display calculated fields about the database (A2002 front end to SQL
Server 2K)
1) I can't seem to enter SQL straight into the control
2) I tried entering things like (in the control) =COUNT( =
|
by: Norma |
last post by:
I am trying to capture data in a date parameter query that spans from
1 to 3 months. I have a field that is a checkbox that notes whether or
not this data is 'red flagged' (so you know, the red flagged data is
end of the month production that is reported in the following months
report)
I need to capture the red flagged production from the previous month
and the production from the entered month(s) not including the red
flagged production...
|
by: John young |
last post by:
I have been looking for an answer to a problem and have found this
group and hope you can assist .
I have been re doing a data base I have made for a car club I am with
and have been trying to make a query that selects from a table as
desribed below ..
I have a table (Volunteer) that has a member field (memnumber)
and a number of fields that are headed in various categories and are
yes/no formated
|
by: Von Bailey |
last post by:
I have a form where the conditional formatting is set on some fields
to bold if certain conditions are met. However, when the conditions
are met some of the data that is to bold is either not showing or only
part of the data in the field displays (i.e. it will display the last
name but not the first name or it will display neither).
When the conditional formatting is removed it displays all the data as
it should be display so the data...
|
by: sara |
last post by:
I am stuck.
I have a report that I use in multiple places, so I call it with
varying parameters (using the Where Clause in the code).
I preview the report, send it to snap, then close the preview (the
user can go to the server to see the snap view). Print, snap, then
close is the only way I can snap with a Where clause.
If there is No data that meets the criteria, I can cancel the print,
| |
by: mmueller |
last post by:
I am new to reporting services 2005 (reporting in Access for years and older versions of Reporting Services from time to time) and this is probably a dumb question... but I have no internal resources since I am the first to use it so... here you go:
I have a report I am trying to recreate, the old one is in a PowerBuilder app and the author is no longer with company. The majority of the report is straightforward, but I am really hung up on...
|
by: kaosx5 |
last post by:
I am running Access 2003. I would like to be able to search the criteria section in an Access query to see if it populated with anything. I have a report database that has a list box and some questions to answer to run the report. They are mant diffenet reports and the criteria can be the same for some and differnet for others. Here is how the report db works:
On the form I have a multiple questions asked to fill in the criteria of the...
|
by: code937 |
last post by:
Im making a report writer for a program ive spent months making, during this time ive written a logger, that logs every action that is made while running the program (so if someone deletes a user or edits something etc) and this report writer looks in the log between 2 dates and pulls out anything that meets criterias. which is then shoved into an RTF Box line at a time (All happening super fast)
how do i make one bit of text bold then the...
|
by: DeZZar |
last post by:
Hi all,
Unfortunately I am quite a novice with Access!! I've created a number
of data bases for my work however becuase my skills are limited to
really built in functionality and wizards my programs are not really
user friendly.
I have searched and searched and tried numerous times to get the
following right to no avail - and I think its really becuase of my
lack of understanding.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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...
|
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,...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |