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

Avatar of undefined
Last Comment
crystal (strive4peace) - Microsoft MVP, Access

8/22/2022 - Mon
Fabrice Lambert

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

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).
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER CERTIFIED SOLUTION
crystal (strive4peace) - Microsoft MVP, Access

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lawrence Salvucci

ASKER
Can I remove the delete request and close this question myself? Thank you.
Lawrence Salvucci

ASKER
Thank you, Crystal! Appreciate your help!!! :)
crystal (strive4peace) - Microsoft MVP, Access

you're welcome, Larry ~ happy to help
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.