Results 1 to 5 of 5

Thread: [RESOLVED] Call a subroutine from one form to another?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    13

    Resolved [RESOLVED] Call a subroutine from one form to another?

    I have a simple question. How do I call a subroutine on another form. Example: I have a project with two forms. From a procedure in form1, I would like to call a subroutine in form2
    Please forgive my ignorance... I'm teaching myself how to program and have had no formal training.
    Thanks.
    Sincerely,
    J

  2. #2
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Re: Call a subroutine from one form to another?

    It's very simple, just use Form2.whatever, where Form2 contains a subroutine called whatever, just remember that the subroutine must be declared as public.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Call a subroutine from one form to another?

    It would be better style to add a code module to your project and add the procedure there and call it from both forms. Note that procedures in codes modules are Public by default.

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    13

    Re: Call a subroutine from one form to another?

    THANK YOU both!!!!!!!!

  5. #5
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Re: [RESOLVED] Call a subroutine from one form to another?

    You're welcome.

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