Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating a textbox in an Access '97 report

Status
Not open for further replies.

dunner44

MIS
Jul 27, 2004
32
US
In a report, what is the formula for a conditional format. Say if my textbox value is greater than 100, how can I format the font color to be red?

Unfortunatley Access 97 doesn't have conditional formatting.

TIA
 
dunner44,
In the OnFormat event of the Detail Section of your report you can place the following code:

'***************************************
Option Compare Database
Option Explicit

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.TextBoxName > 100 Then
Me!TextBoxName.ForeColor = vbRed
Else
Me!TextBoxName.ForeColor = vbBlack
End If
End Sub
'***************************************

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top