Function IsSubForm(f As Form) As Boolean IsSubForm = IsObject(fForm.Parent) End Function
This function can be used to determine whether a form is used as a 'normal' form, or if it is used as a subform. This can then be used to turn certain fields and behaviours on or off, depending on the context. This is especially useful if the form is used both as a normal form and as a sub-form in the same application.