Calling a function or sub on the subform of a subform from the main form

I have a main form that I want to call a function that is on the subform of a subform. I can't for the life of me figure out the vba syntax to call this function/sub that is on a subform of a subform.

I have my main form
Then on that main form I have a subform.
Then on that subform I have a subform. - This is where the function/sub is that I want to call from the main form.
LVL 1
Lawrence SalvucciInformation Technology ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Fabrice LambertFabrice LambertCommented:
Is it an event Handler ?

If so, you'd better delagate the code in a public procedure that you'll write in a standard module.
0
Lawrence SalvucciInformation Technology ManagerAuthor Commented:
No, it's specific to that subform. It's a function that needs to fire on that subform only. I just need to know the syntax to point to it from the main form.
0
Fabrice LambertFabrice LambertCommented:
Well, if you need to call it from "somewhere else", it is no longer "specific".

Even if it is called only once or two, writing a public procedure is not harmfull.
Plus, don't forget that you can give parameters to procedures if needed (even forms).
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Larry,

Call Me.subform1_controlname.Form.subform2_controlname.Form.MyProcedurename

Open in new window

MyProcedurename must be Public

have an awesome day,
crystal
1

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
Lawrence SalvucciInformation Technology ManagerAuthor Commented:
Can I remove the delete request and close this question myself? Thank you.
0
Lawrence SalvucciInformation Technology ManagerAuthor Commented:
Thank you, Crystal! Appreciate your help!!! :)
1
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you're welcome, Larry ~ happy to help
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.