Link to home
Start Free TrialLog in
Avatar of Lawrence Salvucci
Lawrence SalvucciFlag for United States of America

asked on

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.
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

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.
Avatar of Lawrence Salvucci

ASKER

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.
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).
ASKER CERTIFIED SOLUTION
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can I remove the delete request and close this question myself? Thank you.
Thank you, Crystal! Appreciate your help!!! :)
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

you're welcome, Larry ~ happy to help