Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 26th, 2007, 11:12 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old January 29th, 2007, 10:08 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old January 29th, 2007, 01:00 PM
Authorized User
 
Join Date: Jun 2006
Location: , , .
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.

Reply With Quote
  #4 (permalink)  
Old January 29th, 2007, 01:33 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:07 PM.


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