I am working with an Access 2000 database written by someone else. Although I've done alot of VBA programming over the years I am running into things this person did that I don't quite understand. He is obviously at a higher level than myself. My specific question is:
In a form with multiple subforms the original programmer doesn't directly access the properties of the subforms in his code. Instead he uses the following code to create an instance of the subforms:
Code:
Private Function DetailsSheet() As Form_frmRADetailSheet
If mfrmRADetails Is Nothing Then
Set mfrmRADetails = Me!subRADetailSheet.Form
Set mfrmRADetails_Class = mfrmRADetails
End If
Set DetailsSheet = mfrmRADetails
End Function
The subform being accessed is "frmRADetailSheet" and the identifier he uses to access the properties of the subform is "DetailsSheet". Can someone tell me why you would want to access the properties this way instead of accessing them directly like this:
Code:
Me.subRADetailSheet.Form.Property
??
I am interested in this because one of our users continually gets Error#2467, object closed or doesn't exist, when this code is executed and I've narrowed it down to the statements setting the properties of the subform mentioned above.
Thanks in advance for your comments.