Changing Rectangle (Box) Colour in Access 2000

  Mr A! 09:49 31 Jan 05
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 05

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 05

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 05

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 05

it worked an i've solved my problem!

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

New Google phones UK release date | Pixel XL price, new features, specifications: Pixel X and…

1995-2015: How technology has changed the world in 20 years

This is the future of TV, VR and holograms

iOS 10 troubleshooting tips: Simple fixes for the most common iOS 10 problems, from network…