Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Background Colour on Controls

Status
Not open for further replies.

vix666

IS-IT--Management
Jul 17, 2003
63
AU
I have this code below which locks the controls on a form if either of 2 check boxes are ticked. When it locks the controls i also want their background colour to go grey.
The code below kind of works, it locks all the controls if the check box is ticked on that form, but it makes all the form records grey instead of just the ones which are locked.

Private Sub Form_Current()
On Error Resume Next
Dim ctls As Controls
Dim ctlCur As Control
Dim fEnabled As Boolean
Dim i As Integer

fEnabled = (Me![Verify Release] Or Me![Op Verify Release])

Set ctls = Me.Controls

For i = 1 To ctls.Count
Set ctlCur = ctls(i)

ctlCur.Locked = fEnabled
ctlCur.BackColor = "12632256"
ctlCur.ForeColor = "4473924"

Next i

Command56.Enabled = True
Command57.Enabled = True
Command95.Enabled = True

End Sub

Any ideas how i can just make the locked ones turn grey?

Thanks in advance

Vicky
 
If you have Access 2000 or above, try using Conditional Formating.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Nope ive got access 97, any other ideas?

vicky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top