Conditional Formatting Question

  • Thread starter Thread starter Randall Roberts
  • Start date Start date
R

Randall Roberts

I am making a Access report
What i am trying to do is have one field highlighted based on the
contents of another field

Field one is a date it is located in the associates table with the
header orientation date

field two will either say yes or no and is located in the DOC table
with the heading of Completed
what i need to do is have field two
be highlighted if it is NO and the orientation date is more then 30
days ago from Today

Can anyone tell me if this is possible
 
If this is to be done in a report, it doesn't matter which table the fields
are in,
as long as the fields are included in the report's record source.

You haven't indicated which version of access you are using.
In Access 2000 and 2002 you can set the control's Conditional formatting
property.

In Access 97 you must use the Report's Detail Section Format event.

Note: You posted that Field2 will say either Yes or No.
Is that a text "Yes" and a Text "No"?
Or is it a Check Box field Numeric Yes/No value (-1,0)?
Add quotes around the No below if it is a Text datatype field.

Also, what do you mean by 'highlight'?
I'll just change the control's backcolor to red.
You can color it's bordercolor, or forecolor as well.

If [Field2] = No and [DateField1] < Date() - 30 Then
[Field2].BackColor = vbRed
Else
[Field2].BackColor = vbWhite
End If

The above code will also work in Access 2000/2002.
 
Back
Top