conditional formatting

  • Thread starter Thread starter marta
  • Start date Start date
M

marta

Hello,
is it possible to apply conditional formatting to report
results in access. I am familiar with excel's conditional
formatting, but dont know if we can apply the same logic
to access reports.
What i need to do is highlight any positive numbers.
Thanks for your help!
Marta
 
Hello,
is it possible to apply conditional formatting to report
results in access. I am familiar with excel's conditional
formatting, but dont know if we can apply the same logic
to access reports.
What i need to do is highlight any positive numbers.
Thanks for your help!
Marta

Access 2000 and newer contain a Conditional Formatting property for
controls.
Select the control, then click Format + Conditional Formatting.
You can change Forecolor, backcolor, bold, etc.

All versions can use the Format event of the report section to change
the backcolor, forecolor, etc. when the report is run.

If [AField]>0 Then
[AField].BackColor = vbBlue
[AField].ForeColor = vbYellow
Else
[AField].BackColor = vbWhite
[AField].ForeColor = vbBlack
End If

You can also, in all versions, use a control's Format property to
change the forecolor of the control under certain conditions (if the
field is a Number datatype).

Set the control's Format property to:
#[Blue];-#[Red];0[Black]
to show positive values in blue, negative values in red, and zero
values in black.

See Access Help files:
Format property + Number and currency datatype
 
Fred,
Could you be a little more comprehensive ;-)

Good answer.
--
Duane Hookom
MS Access MVP
--

fredg said:
Hello,
is it possible to apply conditional formatting to report
results in access. I am familiar with excel's conditional
formatting, but dont know if we can apply the same logic
to access reports.
What i need to do is highlight any positive numbers.
Thanks for your help!
Marta

Access 2000 and newer contain a Conditional Formatting property for
controls.
Select the control, then click Format + Conditional Formatting.
You can change Forecolor, backcolor, bold, etc.

All versions can use the Format event of the report section to change
the backcolor, forecolor, etc. when the report is run.

If [AField]>0 Then
[AField].BackColor = vbBlue
[AField].ForeColor = vbYellow
Else
[AField].BackColor = vbWhite
[AField].ForeColor = vbBlack
End If

You can also, in all versions, use a control's Format property to
change the forecolor of the control under certain conditions (if the
field is a Number datatype).

Set the control's Format property to:
#[Blue];-#[Red];0[Black]
to show positive values in blue, negative values in red, and zero
values in black.

See Access Help files:
Format property + Number and currency datatype
 
Back
Top