J
Jack
Hi,
I am trying to open a form. During opening the form I need to lockdown the
fields in the form that has the tag of the fields = "Protected" and also all
the fields of the corresponding subform.
The code I am utilzing is as follows:
To lock all the fields of form and subform
Public Sub LockDown(frm As Form)
Dim ctl As Control
For Each ctl In frm.Controls
Select Case ctl.ControlType
Case acSubform
LockDown (ctl.Form)
Case Else
If ctl.Tag = "Protected" Then
ctl.Locked = True
End If
End Select
Next
End Sub
On the form open event I am calling the function as:LockDown(Me)
However this is giving me a error stating type mismatch. I cannot figure out
where I am going wrong. Any help is appreciated.
I am trying to open a form. During opening the form I need to lockdown the
fields in the form that has the tag of the fields = "Protected" and also all
the fields of the corresponding subform.
The code I am utilzing is as follows:
To lock all the fields of form and subform
Public Sub LockDown(frm As Form)
Dim ctl As Control
For Each ctl In frm.Controls
Select Case ctl.ControlType
Case acSubform
LockDown (ctl.Form)
Case Else
If ctl.Tag = "Protected" Then
ctl.Locked = True
End If
End Select
Next
End Sub
On the form open event I am calling the function as:LockDown(Me)
However this is giving me a error stating type mismatch. I cannot figure out
where I am going wrong. Any help is appreciated.