My Assistant
![]() ![]() |
|
|
Apr 1 2005, 11:01 AM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 61 |
Hello,
I was wondering if I can change the colour of a textbox to red if a field has a certain value? I've got a task list, and I want certain tasks to appear in red if the 'importance' fields says High. Thanks, Scott |
|
|
|
Apr 1 2005, 11:06 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Hi,
Try this: If Me.YourFirstControl.Value = "yourvalue" Then Me.YourOthercontrol.BackColor = 255 Else Me.YourOthercontrol.BackColor = white End If HTH Good luck. |
|
|
|
Apr 1 2005, 11:10 AM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 61 |
Silly question, but where should I put that code?
Scott |
|
|
|
Apr 1 2005, 11:16 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Well depends when you want the change of color to happen.
If your importance field has a value already when the form opens that you can put it on the form open event. If you want it if someone types high in the importance field then on the after update event of the importance field. |
|
|
|
Apr 1 2005, 11:42 AM
Post
#5
|
|
|
Retired Moderator Posts: 10,493 From: Lexington/Louisville KY USA |
Check out 'Conditional Formatting' in Access Help. No code required with that.
HTH Noah |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th June 2013 - 04:53 AM |