S
SAC
I'd like to loop through the controls on a form and change the backcolor of
a control if it's data is locked.
Should I use the on_current event to call a function?
I'm attempting to modify the control naming function on the Access Web site.
I don't have something right. Here's the function:
Public Function ControlColoring(objForm As Form) As String
Dim c As Control
Dim strNConv As String
Dim intCount As Integer
With objForm
For Each c In objForm.Controls
If c.Properties.Locked = True Then
c.Properties.BackColor = 14671839
Else:
c.Properties.BackColor = 16777215
End If
Next
End With
End Function
Here's the On_Current event:
Dim strName As String
strName = "Forms![" & Me.Name & "]"
ControlColoring strName
Does the form have to be in design view? If so, is there a work around for
this?
Thanks.
a control if it's data is locked.
Should I use the on_current event to call a function?
I'm attempting to modify the control naming function on the Access Web site.
I don't have something right. Here's the function:
Public Function ControlColoring(objForm As Form) As String
Dim c As Control
Dim strNConv As String
Dim intCount As Integer
With objForm
For Each c In objForm.Controls
If c.Properties.Locked = True Then
c.Properties.BackColor = 14671839
Else:
c.Properties.BackColor = 16777215
End If
Next
End With
End Function
Here's the On_Current event:
Dim strName As String
strName = "Forms![" & Me.Name & "]"
ControlColoring strName
Does the form have to be in design view? If so, is there a work around for
this?
Thanks.