a form that open's either as a form or as a subform

S

Sam

i have a form that can apear either as a form or as a subform
how can i determine on the onload event if it is a form or a subform?

thanks
 
S

Stefan Hoffmann

hi Sam,
i have a form that can apear either as a form or as a subform
how can i determine on the onload event if it is a form or a subform?

Public Function IsSubform(AForm As Access.Form) As Boolean

On Local Error GoTo LocalError

IsSubform = (AForm.Parent.Name <> "")

Exit Function

LocalError:
IsSubform = False

End Function


mfG
--> stefan <--
 
Top