> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Microsoft Access: Check if Form Object is a Subform
- URL: https://nolongerset.com/microsoft-access-check-if-form-object-is-a-subform/
- Published: 2021-05-16T01:46:35.000Z
- Updated: 2026-05-08T13:04:40.000Z
- Description: How do you check if the form object is a subform in Access without triggering a runtime error? Hint: this is a trick question.
- Author: Mike Wolfe
- Tags: Code Library, #FormFunctions, #Import 2026-05-20 02:59

As far as I am aware, there is no property on a form object that you can check to see whether it is either the topmost form or a subform. 

The form object does have a Parent property. If the form is a subform, then it will have a parent object defined in that property. If it is the topmost form, though, any reference to the property will raise error 2452: 

> The expression you entered has an invalid reference to the Parent property.

In fact, we can't even check to see if the property is nothing without raising the above error:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2021/05/image-46.png)

The simplest option, then, is to isolate the IsSubform check in a standalone function and ignore any errors the function may generate.

## The Code: IsSubform()

```vba
'Returns True if the passed form object is a subform of a parent form
Function IsSubform(Frm As Form) As Boolean
    On Error Resume Next
    IsSubform = (Not Frm.Parent Is Nothing)
End Function
```

*Image by [Andreas Wohlfahrt](https://pixabay.com/users/awfotografie-5921373/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=2717347) from [Pixabay](https://pixabay.com/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=2717347)*