Private Sub cmdSubmit_Click()
' Validate Inputs
On Error GoTo Err_Check
Dim strsql As String
strsql = "Select * FROM tblUsers Where UserName = '" & txtUserName.Text & "'"
'Show flash movie
FireTimer
Set rst = New ADODB.Recordset
rst.Open strsql, cnn, adOpenForwardOnly, adLockReadOnly
If Not rst.EOF And Not rst.BOF Then
If rst!Password = txtPwd.Text Then
'Stop the timer
StopTimer
frmSwitch.Show
Me.Hide
Else
flaVerify.Visible = False
'Stop the timer
StopTimer
MsgBox "Invalid Password"
cmdSubmit.Enabled = True
End If
Else
'Stop the timer
StopTimer
flaVerify.Visible = False
MsgBox "Invalid User Name"
cmdSubmit.Enabled = True
End If
rst.Close
Exit_Check:
Set rst = Nothing
Exit Sub
Err_Check:
MsgBox Err.Description, "Login Function"
Resume Exit_Check
End Sub
Sub FireTimer()
Timer1.Enabled = True
flaVerify.Visible = True
cmdSubmit.Enabled = False
End Sub
Sub StopTimer()
Timer1.Enabled = False
flaVerify.Visible = False
cmdSubmit.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 3000
Timer1.Enabled = False
End Sub