Access 97: change color of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to be able to change the color of data in reports based on a
limits table, is this possible without conditional formating which is Access
2000?
 
You can enter the code in the "on print" or the "format" event of the section
where the field is located, in the report.

If Condition=true then
me.FieldName.ForeColor = ChooseAColor
Else
me.FieldName.ForeColor = ChooseAColor
End if
 
Yes, you can use the Format event of the report section the control is in to
change the fore color or back color of the control.

Example:
If Me.txtMyTextbox = 3 Then
Me.txtMyTextbox.BackColor = vbRed
End If

Instead of vbRed, you could use the color picker in the control's Properties
sheet to pick a color then copy and paste the number it gives you into the
code.
 

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

Back
Top