Skip to content

Find out if an Access form is used in a subform context


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.

3
Your rating: None Average: 3 (1 vote)
AdaptiveThemes