How to check if form has subform

A

Allen Browne

Loop through the Controls of the form, to see if any have a ControlType of
acSubform:

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acSubform Then
Debug.Print ctl.Name & " is a subform"
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top