Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Location
    Valentine, New South Wales, Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling form code from a module (AccessXP SP2)

    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.
    Attached Files Attached Files

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

    Re: Calling form code from a module (AccessXP SP2)

    Simple: use

    intTest = Form_frmA.TestFrmAFunction()

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calling form code from a module (AccessXP SP2)

    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.
    Charlotte

Posting Permissions

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