Negative & Positive

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

Guest

Help Needed

How can i negative values to appear in red color and positive value in blue
color.
 
Put the following code in the Current of your form:
Select Case Me!NameOfTextBox
Case > 0
Me!NameOfTextBox.background = vbBlue
Case < 0
Me!NameOfTextBox.background = vbRed
Case Else
Me!NameOfTextBox.background = vbWhite
End Select
 
Is this in a form and if so, is it continuous or single record? Or, are you
asking about a report? You can't do this in a table's datasheet view.

PC Datasheet's response will only work if the form is in single record view.
You might want to search help on Format Property for numeric values.
 
Thx PC Datasheet, your reply was great help.

PC Datasheet said:
Put the following code in the Current of your form:
Select Case Me!NameOfTextBox
Case > 0
Me!NameOfTextBox.background = vbBlue
Case < 0
Me!NameOfTextBox.background = vbRed
Case Else
Me!NameOfTextBox.background = vbWhite
End Select

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
Back
Top