UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Colouring a textbox based on content of a field.    
 
   
moleygunn
post 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
Go to the top of the page
 
+
freakazeud
post 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.
Go to the top of the page
 
+
moleygunn
post Apr 1 2005, 11:10 AM
Post #3

UtterAccess Enthusiast
Posts: 61



Silly question, but where should I put that code?

Scott
Go to the top of the page
 
+
freakazeud
post 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.
Go to the top of the page
 
+
NoahP
post 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 the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th June 2013 - 04:53 AM