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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I display negative numbers in RED instead of black (forms)

Status
Not open for further replies.

judy777

Technical User
Nov 21, 2002
1
NL
Hi,

I would like to display negative numbers in RED instead of black on my forms. That way they stand out more clearly. Is there any way to accomplish this?

I am using MS Access 97.

Thanks,

Greetings from Amsterdam!
Judy
 
Hi!

Access supports conditional formatting. Select the text box you want to change and choose Format/Conditional Formatting and in the window that pops up give the condition as less than zero and the formatting will be to change the font color to red.

hth
Jeff Bridgham
bridgham@purdue.edu
 
You'll have to use an If statement to set the color.
I'm no VB pro but it basically will be like this:

If txtNum < 0 Then
txtNum.ForeColor =&quot;255&quot;
End If

something to that effect anyways. That should get you started until someone posts the 100% correct answer.
hope that helps a little.
 
Check out the help file entry for the Format command, Number data types. You can use the format property to specify that negative numbers be red.

I don't know the correct syntax or I would post it here. The help file should point you in the right direction though. Maq [americanflag]
<insert witty signature here>
 
Simplest way would be to use the 'Format' property of the text boxes you want to make negative numbers red:

#,##0;[Red]#,##0

PS. This is a standard formatting rule
[yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top