• Calling form code from a module (AccessXP SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Calling form code from a module (AccessXP SP2)

    Author
    Topic
    #389792

    How can I call a code in one form from another form or a module. For example, form frmA has a module called Function CheckUser. I would like to open frmA and hide it, and have the ability to open form frmB, for instance, and call Function CheckUser that’s located in frmA to run. Can I do that without putting code in Modules tab. Hope I made myself clear. Find attached small test database in Access97 version showing what I am trying to do.

    Viewing 1 reply thread
    Author
    Replies
    • #690071

      Simple: use

      intTest = Form_frmA.TestFrmAFunction()

    • #690094

      The only thing to add to Hans’ post is that the function you call from the hidden form has to be declared as Public rather than Private. Otherwise, you can’t call it from outside the form.

    Viewing 1 reply thread
    Reply To: Calling form code from a module (AccessXP SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: