Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2003, 04:38 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Controlling Outcome of Access Reports

Is there a way to highlight or change the font color of certain records in an Access report?

For example, I am creating a contracts database for my company, which lists all of the contracts past and present. I need to print this report out monthly to follow up on any contracts that are going to be expiring within the next three months. Is there a way to highlight or change the font color of only the records with contracts that expire within the next three months, while still showing the rest?

Thanks!!

Melissa White
Procurement Assistant
CCE
 
Old September 8th, 2003, 06:41 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

While in design view of the report, click the Status text box. On the
menubar go to Format > Conditional Formatting. A dialog box will pop-up and give you options where you specify your conditions and what format you want to display. There is an 'Add' button so you can specify additional conditions.

HTH,

Beth M
 
Old September 8th, 2003, 06:44 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry... I stated the Status text box because this was a reply to someone else previously on another board... You would select the text box where you want a condition to be met (whatever it may be named), and then set your conditions and formatting.
 
Old September 16th, 2003, 08:02 AM
IMO IMO is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Or you could use this code if you have an Access version earlier than A2K
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

   If Me.TheDateField > Date And Me.TheDateField < DateAdd("m", 3, Date) Then
          Me.TheDateField.FontBold = True
          Me.TheDateField.ForeColor = vbRed
    Else
          Me.TheDateField.FontBold = False
          Me.TheDateField.ForeColor = vbBlack
    End If

End Sub
Just change "TheDateField" to the Name of your Date control.

HTH
IMO






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access VBA - Controlling Text boxes in a form Scripts82 Access VBA 4 February 8th, 2006 08:35 PM
Reports in access nikotromus Access VBA 4 July 31st, 2005 12:57 AM
Access Reports greig_whitney Access VBA 1 August 31st, 2004 12:01 PM
Access reports pankaj_daga Access 4 March 8th, 2004 10:55 AM
help! DAO and controlling access dbs remotely scottie Access VBA 3 November 28th, 2003 05:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.