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?I posted this message before and only had 1 reply, which wasnt relevant as I am using Access 97, so any other help would be great
Thanks in advance
Vicky
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?I posted this message before and only had 1 reply, which wasnt relevant as I am using Access 97, so any other help would be great
Thanks in advance
Vicky