Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form-Subform (2003 (sp2))

    How to execute recalc or refresh, run set of Functions/Macros on Main from OnClose of subform ?
    it looks like I can't define instance of main form in the subform/module appropriately
    thank you

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form-Subform (2003 (sp2))

    A subform opens and closes with the main form, so it doesn't seem necessary to use the On Close event of the subform.

  3. #3
    Lounger
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form-Subform (2003 (sp2))

    Hans,I have to correct myself- it's not an Access Subform, its' basically independent forms, just one called from another
    thank you

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form-Subform (2003 (sp2))

    Let's say that your "main" form is named frmMain.
    Any code in the form module that you want to run from another (form) module must be declared as Public. Keep in mind that event procedures are Private by default, but you can change Private to Public.

    If the frmMain module contains a public procedure (sub) Test, you can call it like this from another module:

    Form_frmMain.Test

    and the Form_Close event procedure can be called like this (provided it has been made Public):

    Form_frmMain.Form_Close

Posting Permissions

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