Hello everybody,
I have form with a subform in datasheet view and a subsubform also in datasheet view. I have a routine that once the main form is open applies permissions to each control (like hiding colums) and when the control is a subform it goes one level below, i.e. runs throught the subform's controls. So it's a nested kind routine.
For some reason I get the error 2455 when trying to get the SubSubFrom Form property from the control which is the SubSubform. It works on the subform, but it stops when going to the SubSubfrm.
Any idea where I am doing wrong?
I have form with a subform in datasheet view and a subsubform also in datasheet view. I have a routine that once the main form is open applies permissions to each control (like hiding colums) and when the control is a subform it goes one level below, i.e. runs throught the subform's controls. So it's a nested kind routine.
For some reason I get the error 2455 when trying to get the SubSubFrom Form property from the control which is the SubSubform. It works on the subform, but it stops when going to the SubSubfrm.
Any idea where I am doing wrong?
Code:
' this a general code on a module
Sub ApplyOptionsOnForm(frm as Form)
....
For Each ctr In frm.Controls
If ctr.Properties("controltype") = acSubform Then
If ctr.Properties("SourceObject") <> "" Then
call ApplyOptionsOnForm(ctr.Form)
End If
End If
End If
Next ctr
.....
End Sub