Conditional Formatting in Access 97

  • Thread starter arogers via AccessMonster.com
  • Start date
A

arogers via AccessMonster.com

How can I apply conditional formatting to fields in a form in Access 97. I
know there is conditional formatting in Access 2000 onwards, unfortunately, I
have Access 97. I want to be able to change the background colour of a date
field as soon as the date a passed the current date or by a specified number
of days passed the current date.

Many thanks

Allan
 
N

NthDegree

You could try something like this:

1. Open the report in design mode.
2. Right click on Detail section heading.
3. Left click on Build Event
4. Use the following type of code.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If DateField1 > #somedate# Then
DateField1.ForeColor = 255
Else
DateField1.ForeColor = 0
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top