Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 March 11th, 2008, 07:31 PM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADP - continuous form color select records

I have a continuous form in an Access Data Project (2003) that requires certain key records to be displayed in red. Because I have more than 3 conditions, I cannot use conditional formatting. I tried using the FormatCondition objects in VBA code to try and extend the three condition format limit to no avail. I used recordsets to no avail either.

Let us say there are 100 records, records with ID 37, 59, 62, 86, 87, and 97 need to have all the textbox controls displayed so that the font is formatted in vbRed for example. The details of formatting are not relevant as is displaying the correct records.

Any suggestions would be appreciated.


 
Old March 13th, 2008, 06:42 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Continuous forms are problematic this way. I would use the On Current event of the form and do something like this:

If Me.ID = 37 Or Me.ID = 59 Or Me.ID = 62 Or Me.ID = 86 Or Me.ID = 87 Or Me.ID = 97 Then
   Me.ID.ForeColor = vbRed
   Me.ID.FontBold = True
Else
   Me.ID.ForeColor = vbBlack
   Me.ID.FontBold = False
End If

This will check every record and apply the conditions. However, I think that this may not work in a continous form. If any condition is met, all the fields will be red and bold.

This works well on the Detail Section's On Format event on a Report, but continuous forms don't have this event. Can you display it in a report?

mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
colour continuous form palmer Access 4 July 29th, 2009 03:26 AM
Continuous Form - Images nilkanth Access 9 July 29th, 2009 02:30 AM
Loop through records on Continuous Form paulcbyrum Access 1 May 13th, 2008 06:28 AM
Filter Records in a continuous form darrenb Access 2 June 1st, 2007 06:50 AM
Highlight and Color records in a continuous form MichaelCree Access VBA 8 March 28th, 2005 05:32 PM





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