jeremia.morling
New member
- Local time
- Today, 03:03
- Joined
- Sep 26, 2008
- Messages
- 2
Hi!
I have a form which I sometimes use standalone, and sometimes as a subform. When used as a subform I would like to load data from the main form when creating new records in the subform.
I thought that I could write something like this in the subform sub "Form_BeforeInsert":
If (Me.Parent <> Null) Then
...
End If
However, if I try to run this code I get runtime error 2452, which says something about illegal reference to the property Parent.
I have tried to search the web for how to write a test for if a parent form exists, but I have not found anything.
Any help would be appreciated!
/ Jeremia
I have a form which I sometimes use standalone, and sometimes as a subform. When used as a subform I would like to load data from the main form when creating new records in the subform.
I thought that I could write something like this in the subform sub "Form_BeforeInsert":
If (Me.Parent <> Null) Then
...
End If
However, if I try to run this code I get runtime error 2452, which says something about illegal reference to the property Parent.
I have tried to search the web for how to write a test for if a parent form exists, but I have not found anything.

Any help would be appreciated!
/ Jeremia