Results 1 to 5 of 5

Thread: MDI / Child question

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    Miami, FL
    Posts
    35

    MDI / Child question

    Can I call a Function that exists on a child form from a toolbar click in the MDI form? I have a toolbar button called Save and a function on the Child form called SaveAppt. What I have right now is:

    VB Code:
    1. Select Case Button.Key
    2.         Case "new"
    3.             Call CreateNewSchedule
    4.         Case "save"
    5.             If gblnWindowExists Then
    6.                 frmChild.SaveAppt
    7.             End If
    8. End Select
    Rich Stern
    http://www.AcidPlanet.com/Jasp182
    http://www.InsomniacRecords.com
    http://www.mp3.com/Jasp182

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If you have multiple instances of frmChild open, you will need to call the particular instance you are looking for.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    Miami, FL
    Posts
    35

    only one instance

    One instance of frmChild only. I know how to use ActiveForm or refer to the form in a collection if that were the case, but I get errors when using ActiveForm.(FunctionName) or frmChild.(FunctionName).

    I can't seem to refer to a form-level variable, collection, or function from a different form. That's what I'm trying to figure out.

    Thanks though.
    Rich Stern
    http://www.AcidPlanet.com/Jasp182
    http://www.InsomniacRecords.com
    http://www.mp3.com/Jasp182

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Are you sure the methods/variables are declared as Public?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    Miami, FL
    Posts
    35
    They weren't. I copied and pasted them from the MDI into the Child form and forgot to do that. Feel free to smack me for asking a stupid question! Thanks.
    Rich Stern
    http://www.AcidPlanet.com/Jasp182
    http://www.InsomniacRecords.com
    http://www.mp3.com/Jasp182

Posting Permissions

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



Click Here to Expand Forum to Full Width