Sub CommandButton1_Click form1_hide form2_show End Sub Sub CommandButton2_Click form2_hide form1_show End Sub '*** Begin Generated Code *** Const AppEXEName = "TwoForms" Const AppPath = "E:\NSBD1\Files\Samples\TwoForms.txt" Form1_Show 'Default Form Dim Form1_Temp Sub Form1_Show On Error Resume Next UpdateScreen If Not IsObject(Form1_Temp) Then AddObject "Form", "Form1", 0, 0, 640, 480 Form1.Visible = False Form1.Caption = "Form1" Set Form1_Temp = Form1 AddObject "CommandButton", "CommandButton1", 208, 160, 108, 21, Form1 CommandButton1.Caption = "Go to Form2" CommandButton1.FontSize = 8.25 '-------- End If Form1.Visible = True Form1_Load End Sub 'Form1_Show Sub Form1_Hide If Not IsObject(Form1_Temp) Then Err.Raise 44000, , "Form not loaded" Exit Sub End If On Error Resume Next Form1.Visible = False Form1_Unload End Sub 'Form1_Hide Dim Form2_Temp Sub Form2_Show On Error Resume Next UpdateScreen If Not IsObject(Form2_Temp) Then AddObject "Form", "Form2", 0, 0, 640, 480 Form2.Visible = False Form2.Caption = "Form2" Set Form2_Temp = Form2 AddObject "CommandButton", "CommandButton2", 136, 48, 108, 21, Form2 CommandButton2.Caption = "Go to Form 1" CommandButton2.FontSize = 8.25 '-------- End If Form2.Visible = True Form2_Load End Sub 'Form2_Show Sub Form2_Hide If Not IsObject(Form2_Temp) Then Err.Raise 44000, , "Form not loaded" Exit Sub End If On Error Resume Next Form2.Visible = False Form2_Unload End Sub 'Form2_Hide '*** End Generated Code ***