Wrox Programmer Forums
|
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 January 26th, 2007, 11:12 AM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default continuous forms question

Hello all, I hope the day is going well for everyone.

I am currently working with continous form, and I have a question about making conditional presentations for each record on the form. For example, let's say each record on the form has a "score" field which is an integer between 0 and 100. If, for that record, the score is below 60, I would like the color of that text field to be red for that record. Any other records with a score of 60 or above would keep the default color.

I am decent with VBA, and I have been playing around with the OnLoad event, but that I can't that to work yet.

Anyways, thanks for the help. Have a good one.

 
Old January 29th, 2007, 10:08 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Use the detail section's On Format event. If you use conditional formatting, then all the records willl turn red if any of them meet the criteria. Use the on format event and do this:

If Me.Score < 60 Then
   Me.Score.ForeColor = vbRed
Else
   Me.Score.ForeColor = vbBlack
End If

Did that work?

mmcdonal
 
Old January 29th, 2007, 01:00 PM
Authorized User
 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply. When I pull up the Detail section's properties, I do not see an On Format event. I am using Access 2003. Do you know if this is something available on a different version of Access?

These are the available events listed under the Detail section:

On Click
On Dbl Click
On Mouse Down
On Mouse Move
On Mouse Up

It looks like all of these events are dependant on user interaction.

Thanks for the help.

 
Old January 29th, 2007, 01:33 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I was wrong, use the conditional formatting.

Select the score field in Design View, select Format > Conditional Formatting, then set the properties to:

Greater than, 60, Red (Bold?)

Sorry for the run around.

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating Continuous Forms Bobbyworld Access VBA 8 May 13th, 2007 03:28 AM
Checkboxes and continuous forms mdProgrammer Access VBA 4 August 3rd, 2006 09:47 AM
Continuous Forms Issues strikeuk Access 1 January 2nd, 2006 11:59 AM
Continuous Forms Ben Access VBA 2 February 17th, 2004 10:34 AM
Continuous forms - highlighting a record Clive Astley Access 1 July 24th, 2003 11:47 AM





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