Results 1 to 3 of 3

Thread: help linking forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    3
    i am a awfull newbie, in need of help. I am doing some tutorials and learning fast. However on my current project in VB 6.0, i dont know how to simply get another form to show after clicking a command button. What code snippet needs to be in the command button to show another form and close the original form or hide the original after command button clicked.

    Thanks in advance. i am also looking for a teacher if anyone has some free time to help me learn? i really could use the help getting started.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    This will go in the button on your first form, it assumes your second frm is called Form2.

    Code:
    Private Sub Command1_Click()
        Me.Hide
        Form2.Show
    End Sub
    Because this code goes in the button click event of a button on Form1, the "Me." means "Form1.", that is, Me refers to the current form, Form1 in this case.

    if you didn't want to just hide Form1, but wanted to unload it, the code would be:

    Code:
    Private Sub Command1_Click()
        Unload Me
        Form2.Show
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    3

    Thanks

    That worked. thank you a bunch. i like the unload better then just the hiding. After the user clicks the comand button the first form is really no longer needed. i was curious how to tell it to get lost and play in the traffic, lol

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