Why is this isn't working? I can't make form1 go to form2.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abegail
    New Member
    • Sep 2010
    • 1

    Why is this isn't working? I can't make form1 go to form2.

    Private Sub Command1_Click( )

    Dim Response

    If Text1.Text = Text1.Tag Then

    MsgBox "Good! Password Accepted.", vbOKOnly + vbExclamation, "Access Granted!"
    Form1.Hide

    Form2.Show

    Else

    Response = MsgBox("Error! Password is wrong.", vbRetryCancel + vbCritical, "Access Denied!")

    If Response = vbRetry Then

    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)
    Text1.SetFocus

    Else


    End If
    End If
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    There is no "End Sub" !!!

    Code:
    Private Sub Command1_Click()
    Dim Response
       With Text1
          If .Text = .Tag Then
             MsgBox "Good! Password Accepted.", vbOKOnly + vbExclamation, "Access Granted!"
             Form1.Hide
             Form2.Show
          Else
             Response = MsgBox("Error! Password is wrong.", vbRetryCancel + vbCritical, "Access Denied!")
             If Response = vbRetry Then
                .SelStart = 0
                .SelLength = Len(.Text)
                .SetFocus
             End If
          End If
       End With
    End Sub

    Comment

    Working...