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

Lawrence Salvucci
Lawrence Salvucci used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fabrice LambertConsulting
Distinguished Expert 2017

Commented:
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.
Lawrence SalvucciDirector of Information Technology

Author

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.
Fabrice LambertConsulting
Distinguished Expert 2017

Commented:
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).
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Remote Training and Programming
Top Expert 2015
Commented:
hi Larry,

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

Open in new window

MyProcedurename must be Public

have an awesome day,
crystal
Lawrence SalvucciDirector of Information Technology

Author

Commented:
Can I remove the delete request and close this question myself? Thank you.
Lawrence SalvucciDirector of Information Technology

Author

Commented:
Thank you, Crystal! Appreciate your help!!! :)
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
Top Expert 2015

Commented:
you're welcome, Larry ~ happy to help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial