Return the name of the active/with focus subform

Good afternoon

I am trying to return the name of the active form, where the form in question is a sub form. Code for example:
Set frmCurrentForm = Screen.ActiveForm

Using Screen.ActiveForm or Me when trying to return the name of a subform actually returns the name of the parent form. Is there a way to return the name of just the sub form? and is there away to name the parent forms seperately (especially if there are a number of nested subforms).

thanks

Matt
mattryanjerseyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TWBitCommented:
True, using Screen.ActiveForm will display the parent, but from the subform itself, you can just us Me.name

Also check out this very handy page for references:
http://www.mvps.org/access/forms/frm0031.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
peter57rCommented:
If the code is in the subform, then me.name will return the name of the subform.

If you are running code in a standard module you do things like:

Forms!orders1.ActiveControl.Name      to get the name of the subform control on th main form
Forms!orders1.ActiveControl.Form.Name     to get the name of the subform
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What, exactly, are you trying to do with the reference to your subform? A subform is actually a member of the Controls collection of the parent form, and you should always get a handel to the subform through the parentform, as peter suggests.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.