P peterbowles Registered User. Local time Today, 00:55 Joined Oct 11, 2002 Messages 163 Apr 15, 2003 #1 If a number is a negitive how do you change the font colour to RED Thanks
Mile-O Back once again... Local time Today, 00:55 Joined Dec 10, 2002 Messages 11,305 Apr 15, 2003 #2 If Sgn(YourNumber) = -1 Then YourControl.ForeColor = vbRed If your original colour is Black then you might prefer to use the IIf statement. YourControl.ForeColor = IIf(Sgn(YourNumber) = -1, vbRed, vbBlack)
If Sgn(YourNumber) = -1 Then YourControl.ForeColor = vbRed If your original colour is Black then you might prefer to use the IIf statement. YourControl.ForeColor = IIf(Sgn(YourNumber) = -1, vbRed, vbBlack)
R Rich Guest Apr 15, 2003 #3 Set the display format for the control to £#,##0.00[Black];£#,##0.00[Red], remove the currency symbol if it's just a number
Set the display format for the control to £#,##0.00[Black];£#,##0.00[Red], remove the currency symbol if it's just a number
P peterbowles Registered User. Local time Today, 00:55 Joined Oct 11, 2002 Messages 163 Apr 15, 2003 #4 Thanks just got two questions YourControl.ForeColor = IIf(Sgn(YourNumber) = -1, vbRed, Is YourControl the txtbox that contains the number What is YouNumber
Thanks just got two questions YourControl.ForeColor = IIf(Sgn(YourNumber) = -1, vbRed, Is YourControl the txtbox that contains the number What is YouNumber
Mile-O Back once again... Local time Today, 00:55 Joined Dec 10, 2002 Messages 11,305 Apr 15, 2003 #5 Sorry, YourNumber was the value you were evaluating so in this case it would be YourControl. YourControl is the textbox that contains the number.
Sorry, YourNumber was the value you were evaluating so in this case it would be YourControl. YourControl is the textbox that contains the number.
P peterbowles Registered User. Local time Today, 00:55 Joined Oct 11, 2002 Messages 163 Apr 15, 2003 #6 the code does work But the form the control is on is a sub form I have tried all the EVents but non of them will pick it up Any ideas Thanks
the code does work But the form the control is on is a sub form I have tried all the EVents but non of them will pick it up Any ideas Thanks
P peterbowles Registered User. Local time Today, 00:55 Joined Oct 11, 2002 Messages 163 Apr 15, 2003 #8 Can you explain how you do this £#,##0.00[Black];£#,##0.00[Red], thanks
Mile-O Back once again... Local time Today, 00:55 Joined Dec 10, 2002 Messages 11,305 Apr 15, 2003 #9 Copy and paste it verbatim into your textbox's format property.