test for parent

  • Thread starter Thread starter mcnews
  • Start date Start date
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
..
 
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!
 
Back
Top