Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Canberra, ACT Australia

    Unanswered: on click command button to open a new form

    Hi people
    Could someone tell me how to get VB6 to open a new form, close the current/old form and maximise the new form with click on a command button.

    I have been developing in MS Access where this is done pretty well automatically - some minor adjustments - but I am having trouble in VB. I have tried a cut and paste from code I have developed in Access, but to no avail. There doesn't appear to be an 'on-click' option to lead to a procedure; but only to the actuaL code screen.

    thanks in advance.

  2. #2
    Join Date
    Jul 2004
    Hi! supposing that you are in Form1 and have a command button on it which will open a new form (Form2) when clicked.

    Private Sub Command1_Click()
    Form2.Show 'opens a new form named Form2
    Unload Me 'unload current form (Form1)
    End Sub

Posting Permissions

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