test for parent

J

John Spencer

UNTESTED AIRCODE follows

Function fCheckParent(frmAny as Form) as Boolean
Dim v as Variant
On Error GoTo fCheckParent_Error

v = frmAny.Parent
fCheckParent = True

fCheckParent_Error:
If Err.Number <> 2454 then
msgbox err.number & ": " & Err.description
End Function

You probably can use the form's on load event
If fCheckParent(me) = True then
...
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
M

mcnews

UNTESTED AIRCODE follows

Function fCheckParent(frmAny as Form) as Boolean
Dim v as Variant
On Error GoTo fCheckParent_Error

v = frmAny.Parent
fCheckParent = True

fCheckParent_Error:
If Err.Number <> 2454 then
msgbox err.number & ": " & Err.description
End Function

You probably can use the form's on load event
If fCheckParent(me) = True then
...
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

seems to work.
had to add 2452 in the error trap.
thanks much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top