D
dgy
I designed a form that should only ever be used as a sub-form in another
(parent) form.
It all works well except that I thought I would ensure it is never opened
directly and only ever as part of the parent form.
In the sub-form's Form_open event I thought I'd be able to just check
whether the sub-form's Parent property is Null or Nothing or Empty (or
something) but when I do, I immediately get a 2452 error. I had planned to
check the parent's name if it wasn't nothing (or null or empty).
Is there a clever way to ensure that the sub-form is only ever opened on a
particular form?
I suppose I could do it by trapping for the 2452 error but that doesn't seem
very elegant.
TIA,
David Young
(parent) form.
It all works well except that I thought I would ensure it is never opened
directly and only ever as part of the parent form.
In the sub-form's Form_open event I thought I'd be able to just check
whether the sub-form's Parent property is Null or Nothing or Empty (or
something) but when I do, I immediately get a 2452 error. I had planned to
check the parent's name if it wasn't nothing (or null or empty).
Is there a clever way to ensure that the sub-form is only ever opened on a
particular form?
I suppose I could do it by trapping for the 2452 error but that doesn't seem
very elegant.
TIA,
David Young