formulario acceso al sistema en vb 6.0

Iniciado por W4rR3d, 19 Febrero 2011, 15:52 PM

0 Miembros y 1 Visitante están viendo este tema.

W4rR3d

 proyecto llamado acceso al sistema en vb 6.0

Private Sub Aceptar_Click()
  If Len(TxtClave.Text) <> 0 Then
      usuarios.Recordset.FindFirst "Login='" & TxtUsuario.Text & "' and Clave='" & TxtClave.Text & "'"
       If usuarios.Recordset.NoMatch = False Then
           ProgressBar1.Visible = True
           For i = 1 To 800
               Me.ProgressBar1 = i
           Next
           Unload Me
           Form2.Show
       Else
           Contador = Contador - 1
           If Contador = 0 Then
               MsgBox "Su Tiempo a Finalizado," & " Ud. Sr(a):  " + TxtUsuario.Text + " no es Usuario de este Sistema"
               End
           End If
           MsgBox "Usuario Incorrecto Le Queda" & Space(5) & Contador & Space(5) & "Intentos"
           TxtClave = ""
           TxtClave.SetFocus
       End If
    End If
End Sub


Private Sub Cancelar_Click()
If MsgBox("Seguro que desea Salir?", vbYesNo + vbExclamation, "Salir del Sistema") = vbYes Then
   End
End If
End Sub


Private Sub Form_Activate()
TxtUsuario.SetFocus
End Sub


Private Sub Form_Initialize()
Contador = 3
End Sub


Private Sub Form_Load()
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
End Sub


Private Sub TxtClave_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Aceptar.Enabled = True
Aceptar.SetFocus
End If
End Sub


Private Sub TxtUsuario_Change()
TxtUsuario = StrConv(TxtUsuario.Text, vbProperCase)
TxtUsuario.SelStart = Len(TxtUsuario)
End Sub


Private Sub TxtUsuario_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Me.TxtClave.SetFocus
End Sub