By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,222 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,222 IT Pros & Developers. It's quick & easy.

BackColor On TextBox

P: n/a
I would like to change the back color on a Text Box on a Access97
Form....

I have a formula in the text box that adds up in Currency...
=[Text12]+[Text14].... the format is this +$#,###.00;-$#,###.00 to
show me wether the amount is negative or possitive...

But I want to do the following:

If the dollar amount is Negative, I want the BackColor to change to
Red with the ForeColor to change to White.

If the dollar amount is Possitive, I want the BackColor to change to
Green, and the ForeColor will remain black.

Thanks for taking the time to help me....

Mike
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 11 Feb 2004 15:55:22 -0800, Mike wrote:
I would like to change the back color on a Text Box on a Access97
Form....

I have a formula in the text box that adds up in Currency...
=[Text12]+[Text14].... the format is this +$#,###.00;-$#,###.00 to
show me wether the amount is negative or possitive...

But I want to do the following:

If the dollar amount is Negative, I want the BackColor to change to
Red with the ForeColor to change to White.

If the dollar amount is Possitive, I want the BackColor to change to
Green, and the ForeColor will remain black.

Thanks for taking the time to help me....

Mike


Mike,
In Access 97 single Form View:
Code the Form's Current event, as well as the After Update events of
both [Text12] and [Text14]:

If [TextBoxName]<0 Then
[TextBoxName].BackColor = vbRed
[TextBoxName].ForeColor = vbWhite
Else
[TextBoxName].BackColor = vbGreen
[TextBoxName].ForeColor = vbBlack
End If

If you don't need to change the backcolor, you could simply change the
Format property of the control to:

+$#,###.00 [black];-$#,###.00 [red]

In continuous form view, see if

http://www.lebans.com

has anything you can use in Access 97.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.