Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling Function (Access 2000)

    Is it possable to call a function in one form when the focus is on another form?

    Thanks

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

    Re: Calling Function (Access 2000)

    Yes, that is possible if the form is open AND if the function (or procedure) has been declared as Public. If a function (or procedure) has been declared as Private, it is not available outside the module in which it resides.

    Say that the function is called TestFunc and is defined in the form module of frmMyForm. You would call it like this from another form:

    MsgBox Form_frmMyForm.TestFunc

    or

    MsgBox Forms!frmMyForm.TestFunc

    In this example, the function has no arguments; if it does, you must provide them, of course.

Posting Permissions

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