473,796 Members | 2,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I bold a field in a report if it meets criteria?

5 New Member
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...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2.     Dim strDivision As String
  3.     Dim strTerm As String
  4.     Dim strEmpType As String
  5.     Dim dteCurrentdate As Date
  6.  
  7.     'Open the form to get the variables
  8.     DoCmd.OpenForm "SelectReportCriteriaEval", acNorman, , , , acDialog
  9.  
  10.     ' Get the Seleceted Values
  11.     strDivision = Nz(Forms("SelectReportCriteriaEval")!selDivision, " ")
  12.     strTerm = "N"
  13.     strEmpType = "Temp"
  14.     dteCurrentdate = DateAdd("m", 1, Date)
  15.     'MsgBox "strDivision = " & strDivision
  16.  
  17.     ' Set the recordsource for the report
  18.         If strDivision <> "ALL" Then
  19.             Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
  20.                               "WHERE Division = '" & strDivision & "' " & _
  21.                               "AND EmpType LIKE '[" & strEmpType & "]*' " & _
  22.                               "AND Terminated Like '" & strTerm & "' " & _
  23.                               "AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreFlag = 'N') OR " & _
  24.                               "(The6MEvalDate <= #" & dteCurrentdate & "# AND The6MEvalScoreFlag = 'N') OR " & _
  25.                               "(The12MEvalDate <= #" & dteCurrentdate & "# AND The12MEvalScoreFlag = 'N'))"
  26.         Else
  27.             Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
  28.                               "WHERE EmpType LIKE '[" & strEmpType & "]*' " & _
  29.                               "AND Terminated Like '" & strTerm & "' " & _
  30.                               "AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreFlag = 'N') OR " & _
  31.                               "(The6MEvalDate <= #" & dteCurrentdate & "# AND The6MEvalScoreFlag = 'N') OR " & _
  32.                               "(The12MEvalDate <= #" & dteCurrentdate & "# AND The12MEvalScoreFlag = 'N'))"
  33.  
  34.         End If
  35.  
  36.     'MsgBox "Me.RecordSource = " & Me.RecordSource
  37.  
  38.            ' MsgBox "Me.Date = " & FThe3MEvalDate
  39.  
  40.            '       MsgBox "Me.Date = " & dteCurrentdate
  41.  
  42.     If The3MEvalDate <= dteCurrentdate Then
  43.         If The3MEvalScoreFlag = "N" Then
  44.             Me.FThe3MEvalDate.BackColor = "RED"
  45.         End If
  46.     End If
  47.     If The6MEvalDate <= dteCurrentdate Then
  48.         If The6MEvalScoreFlag = "N" Then
  49.             Me.FThe6MEvalDate.BackColor = "RED"
  50.         End If
  51.     End If
  52.     If The12MEvalDate <= dteCurrentdate Then
  53.         If The12MEvalScoreFlag = "N" Then
  54.             Me.FThe12MEvalDate.BackColor = "RED"
  55.         End If
  56.     End If
  57.  
  58.     DoCmd.Close acForm, "SelectReportCriteriaEval"
  59. 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!
Feb 15 '08 #1
6 2821
missinglinq
3,532 Recognized Expert Specialist
Assuming you're running ACC2000 or later, you can do this using Conditional Formatting, just like you would in a form.

Linq ;0)>
Feb 16 '08 #2
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:

Expand|Select|Wrap|Line Numbers
  1. Dim vRed as Long
  2. vRed RGB(255,0,0)
  3. Me!txtControl.BackColor = vRed
  4.  
Feb 16 '08 #3
Stewart Ross
2,545 Recognized Expert Moderator Specialist
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:

Expand|Select|Wrap|Line Numbers
  1.  If (condition you are testing) then 
  2.     Me.[name of the control you want to embolden].Fontbold = True
  3. else
  4.     Me.[name of the control you want to embolden].Fontbold = False
  5. Endif
  6.  
If your condition is easily readable and understandable you could shorten this to
Expand|Select|Wrap|Line Numbers
  1.  
  2. Me.[name of the control you want to embolden].Fontbold = (condition you are testing)
  3.  
-Stewart
Feb 16 '08 #4
tmoon3
5 New Member
Thanks to all! (I have had the flu and just now gettign back to work)
Feb 21 '08 #5
missinglinq
3,532 Recognized Expert Specialist
Glad we could help! Hope you're feeling better!

Linq ;0)>
Feb 21 '08 #6
Scott Price
1,384 Recognized Expert Top Contributor
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
Feb 21 '08 #7

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

Similar topics

5
2926
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( =
3
2021
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...
13
3528
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
2
2967
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...
15
3139
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,
0
1401
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...
1
1437
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...
0
1018
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...
7
12510
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.
0
9673
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, 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...
0
9525
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
10452
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...
1
10169
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,...
1
7546
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 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...
0
6785
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();...
0
5440
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...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
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.