What form call the function?

seba64

New Member
Joined
Apr 24, 2016
Messages
31
Think that it is possible for a function to know the name of the form that called it.?

think that function can be in at unknown project of a unknown programmer.

with an object like parameter i can found the parent, but in this function i haven't any object like parameter.

I hope you understand the question.
 
Last edited:

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
1,823
you have it before the function

MsgBox me.Name
call MyFunction

or put the form in the param of the function.
Code:
public Function MyFctn(byval pfrm as form)
   msgbox pfrm.name
end function
 
Last edited:

seba64

New Member
Joined
Apr 24, 2016
Messages
31
you have it before the function

MsgBox me.Name
call MyFunction

or put the form in the param of the function.
Code:
public Function MyFctn(byval pfrm as form)
   msgbox pfrm.name
end function
you are right, but what about if any people take and use that function and not put the parameter or the correct parameter (don't put the name of the correct parameter or the correct name of form at parameter)?
 
Last edited:

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,624
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Why would you need this?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,624
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
With respect, that doesn't really address my question. What use would it be if you have no control over the function anyway?
 

Forum statistics

Threads
1,086,241
Messages
5,388,653
Members
402,131
Latest member
maxneo553

Some videos you may like

This Week's Hot Topics

Top