Howto check where is my subform? (in Form1 or Report1?)

I create a subform in Form1 and in Report1 for printing.
how can I write in the subform VBA to check Where is my subform?
in Form1 or Report1?
How can I access to Form1 or Report1 objects in the subform VBA?
Who is Participating?
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
This VBA code, when executed in a subform, will return the name of whatever the main form is.

msgbox Me.Parent!Name
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.