PC Review


Reply
Thread Tools Rate Thread

Color Coding Numbers

 
 
Ben
Guest
Posts: n/a
 
      24th Apr 2009
Is there a way for the color to change on a number feild inside a form when
it reaches above or below a set ammount. Like if you set the cap at 30,000 as
long as the feild is below the cap it stays green, if it goes above it turns
red. Or its green while the number is a negative amount then red when a
positive amount.

Thanks, Ben
 
Reply With Quote
 
 
 
 
Al Campagna
Guest
Posts: n/a
 
      24th Apr 2009
Ben,
If you're using A2000 or greater, you can use
Conditional Formatting to handle that.
or
Assuming a single form... and an text control named
FinalAmt,... you can set the color in the AfterUpdate event
of any field (or fields) that effect that FinalAmt.

If FinalAmt < 30000 Then
FinalAmt.Forecolor = vbRed
Elseif
FinalAmt.Forecolor = vbGreen
End Sub

You'll also need that same code in the OnCurrent event of the form
itself. That will handle the colors when browsing from one record to
another.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Ben" <(E-Mail Removed)> wrote in message
news:04AAA7E1-6933-4EB5-9B3A-(E-Mail Removed)...
> Is there a way for the color to change on a number feild inside a form
> when
> it reaches above or below a set ammount. Like if you set the cap at 30,000
> as
> long as the feild is below the cap it stays green, if it goes above it
> turns
> red. Or its green while the number is a negative amount then red when a
> positive amount.
>
> Thanks, Ben



 
Reply With Quote
 
RonaldoOneNil
Guest
Posts: n/a
 
      24th Apr 2009
With your form in design mode and the relevant textbox highlighted, click on
Format - Conditional Formatting on the menu bar.
Select your conditions & format colours accordingly and then save your form.

"Ben" wrote:

> Is there a way for the color to change on a number feild inside a form when
> it reaches above or below a set ammount. Like if you set the cap at 30,000 as
> long as the feild is below the cap it stays green, if it goes above it turns
> red. Or its green while the number is a negative amount then red when a
> positive amount.
>
> Thanks, Ben

 
Reply With Quote
 
Ben
Guest
Posts: n/a
 
      24th Apr 2009
WOW thanks for the tip it work great, been working with access on and off for
about 3 years and I didn't realize that was there.

Thanks

"RonaldoOneNil" wrote:

> With your form in design mode and the relevant textbox highlighted, click on
> Format - Conditional Formatting on the menu bar.
> Select your conditions & format colours accordingly and then save your form.
>
> "Ben" wrote:
>
> > Is there a way for the color to change on a number feild inside a form when
> > it reaches above or below a set ammount. Like if you set the cap at 30,000 as
> > long as the feild is below the cap it stays green, if it goes above it turns
> > red. Or its green while the number is a negative amount then red when a
> > positive amount.
> >
> > Thanks, Ben

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
color coding Kimi Mac Microsoft Outlook Calendar 1 25th Feb 2009 01:43 PM
color coding =?Utf-8?B?Q2hyaXM=?= Microsoft Excel Misc 2 9th May 2007 06:43 PM
color coding Ardilla Microsoft Excel Worksheet Functions 1 11th Jan 2006 08:49 PM
color coding numbers in excel Mackbeer Microsoft Excel Discussion 2 27th Jun 2005 07:12 PM
color coding largest numbers in a list Robert L. Salisbury Microsoft Excel Misc 4 7th Jan 2004 05:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 PM.