How can I format color in my query

  • Thread starter Thread starter Themba via AccessMonster.com
  • Start date Start date
T

Themba via AccessMonster.com

When i run my query i've realised i got negative numbers.So i'd would like to
change the color for the negative numbers numbers to red.And the positive
ones should remain black.how can I do this
 
You should really use forms whenever possible. In any case you can set the
format property of the column/text box to something like:

#,##0.00[Black];(#,##0.00)[Red];0.00;"Null"
 
I understand, you want the negative numbers to show up coloured in a report.

Have the report in design view and call up the code window.
The following example shows different colours at given blood pressure levels:

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

Select Case Me!Diastole
Case Is = "N/A"
With Me!Diastole
.ForeColor = QBColor(0)
.FontBold = False
End With

Case Is <= 90
With Me!Diastole
.ForeColor = QBColor(2)
.FontBold = True
End With

Case Else
With Me!Diastole
.ForeColor = QBColor(12)
.FontBold = True
End With

End Select

End Sub

Configure the “Select Case†to your needs.
Hope this helps.
 

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