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?
 
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
 
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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