Results 1 to 7 of 7

Thread: What form call the function?
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member seba64's Avatar
    Join Date
    Apr 2016
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default What form call the function?

    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 by seba64; Feb 27th, 2019 at 10:36 AM.

  2. #2
    Board Regular ranman256's Avatar
    Join Date
    Jun 2014
    Location
    Kentucky
    Posts
    1,775
    Post Thanks / Like
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What form call the function?

    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 by ranman256; Feb 27th, 2019 at 10:58 AM.

  3. #3
    New Member seba64's Avatar
    Join Date
    Apr 2016
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What form call the function?

    Quote Originally Posted by ranman256 View Post
    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 by seba64; Feb 27th, 2019 at 12:42 PM.

  4. #4
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,970
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: What form call the function?

    Why would you need this?

  5. #5
    New Member seba64's Avatar
    Join Date
    Apr 2016
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What form call the function?

    Quote Originally Posted by RoryA View Post
    Why would you need this?
    I try to make tools for vb and vba
    Maybe it's strange for you or many

  6. #6
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,970
    Post Thanks / Like
    Mentioned
    52 Post(s)
    Tagged
    6 Thread(s)

    Default Re: What form call the function?

    With respect, that doesn't really address my question. What use would it be if you have no control over the function anyway?

  7. #7
    New Member seba64's Avatar
    Join Date
    Apr 2016
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: What form call the function?

    Quote Originally Posted by RoryA View Post
    With respect, that doesn't really address my question. What use would it be if you have no control over the function anyway?
    Many optional parameters control the function!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •