Results 1 to 12 of 12

Thread: switching forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    7

    switching forms

    I m new to visual basic and am taking a class I m trying to switch forms in a document there are 6 forms and i want to change to the other form by clicking a button i used the open command but it tells me that the form is already open when i run the programm is there anything i can do.

  2. #2
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: switching forms

    IS the form realy open then?
    If yes, you can add
    VB Code:
    1. On Error Resume Next
    so it give not an error.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    7

    Re: switching forms

    its all the same project like they are in a list form1 form2 all in the same project and when i run it only the first form pops up and i want to make it so i can open and close the other forms.

  4. #4
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: switching forms

    Very easy.
    Put this in a button or what:
    VB Code:
    1. Form2.Show vbModal
    And you'll see that Form2 will show.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    7

    Re: switching forms

    thanks

  6. #6
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: switching forms

    np

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: switching forms

    modal won't let you open any other forms until you close the modal one. make sure that is what you want to do.

  8. #8
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: switching forms

    ooh, I didn't know that

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: switching forms

    Now you do. Anything else?

  10. #10
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: switching forms

    I don't............maybe altrods?

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: switching forms

    I don't understand.

  12. #12
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Talking Re: switching forms

    Quote Originally Posted by altrods
    I m new to visual basic and am taking a class I m trying to switch forms in a document there are 6 forms and i want to change to the other form by clicking a button i used the open command but it tells me that the form is already open when i run the programm is there anything i can do.
    Try this buddy!

    VB Code:
    1. Private Sub Command1_Click()
    2. Form1.Hide
    3. Form2.Show
    4. End Sub

    I was just trying to figure that out myself so I thought I would pass it on to you! Let me know how it works!

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