Negative & Positive

A

Aamer Sheikh

Help Needed

How can i negative values to appear in red color and positive value in blue
color.
 
P

PC Datasheet

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
 
D

Duane Hookom

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.
 
A

Aamer Sheikh

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
 
A

Aamer Sheikh

Thx Duane, PC Datasheet's & your reply was great help.it really cleared my
mind.
 

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

Top