Results 1 to 7 of 7

Thread: Switching between forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Switching between forms

    Hello I'm pretty new at visual basic and I can't seem to figure out how to switch between forms.. I want to be able to click a Next button and proceed to my other form. any helps or hints would be appreciated.

  2. #2
    Member Endorphine's Avatar
    Join Date
    Dec 2009
    Location
    Shelby, Ohio
    Posts
    51

    Re: Switching between forms

    Put this into the Command button:
    Code:
    formname.show
    replace formname with the name of that form.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: Switching between forms

    thanks alot

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: Switching between forms

    Well now i have another question I want the other form to close when the other opens..

    I figure you would just say Form1.Close() or Me.Close() but this closes all the forms.. how can i change that

  5. #5
    Member Endorphine's Avatar
    Join Date
    Dec 2009
    Location
    Shelby, Ohio
    Posts
    51

    Re: Switching between forms

    Code:
    hide.me
    I think .... =/

    or try
    Code:
    formname.hide

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Switching between forms

    That will not close the form, but simply hide it - which uses (and perhaps wastes) memory, and may stop the program from closing when it is finished.

    Unless you have a particular reason for keeping it open, you should unload it:
    Code:
    Unload Me
    or:
    Code:
    Unload Form1
    ..and that should be followed by Exit Sub (or Exit Function etc as apt) so that you don't accidentally re-load it.
    Quote Originally Posted by kel_e View Post
    I figure you would just say Form1.Close() or Me.Close() but this closes all the forms.. how can i change that
    There is no pre-made .Close method, so that is something you have written yourself.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Switching between forms

    Why not stay with just one form and switch between frames on that form (like a wizard does)?

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