Changing Rectangle (Box) Colour in Access 2000

  Mr A! 09:49 31 Jan 2005
Locked

I would like a box to turn orange when a field (message) in a record is entered to "yes", and when is "no" turns back to transparent. A bit like a warning light on a till!

Can anybody help me as i am totally stuck?
Thanks, Aden

  AccessMoron 12:28 02 Feb 2005

use a check box, and in the after update event of the check box turn the transparent peoperty of the approrpriate text box on and off

  Rand Al Thor 13:35 02 Feb 2005

Put this code in the After Update event of the TextBox that holds your "yes" "no"

Private Sub YourTextBoxName_AfterUpdate()
Const vbOrange = 4227327
If Me.YourTextBoxName.Value = "yes" Then
Me.TheNameOfTheTextBoxThatChangesColour.BackColor = vbOrange
Else
Me.TheNameOfTheTextBoxThatChangesColour.Visible = False
End If

End Sub

  Rand Al Thor 13:39 02 Feb 2005

It hasn't formatted it very well. Const should be on a new line, so should be the if statement. Else should also be on a new line together with the second Me statement. End If also on a new line. Sorry about that.

  Mr A! 18:33 02 Feb 2005

it worked an i've solved my problem!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Acer Predator 21X review

Best Free Video Tutorials for Drawing and Painting

Best podcast apps for iPhone & iPad

Nokia 8 : design, caractéristiques techniques, date de sortie