Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2006, 06:55
Avatar de vbx3m
vbx3m
 
Fecha de Ingreso: febrero-2005
Ubicación: Venezuela
Mensajes: 524
Antigüedad: 19 años, 3 meses
Puntos: 1
La forma mas sencilla seria

Código:
Private Sub Text2_KeyPress(KeyAscii As Integer) 'Seria el text de contraseña
If KeyAscii = 13 Then
    If Text1.Text = "Administrador" And Text2.Text = "TPHMM23VQK" Then
       Form2.Show
       Unload Me
   Else
      MsgBox "DATOS INCORRECTOS"
   End If
End If
End Sub

Otra forma de hacerlo es utilizando una funcion:


Código:
Private Function autentificar(user As String, pass As String)
If user = "Administrador" And pass = "TPHMM23VQK" Then
   Form2.Show
   Unload Me
Else
   MsgBox "DATOS INCORRECTOS"
End If
End Function

Private Sub Text2_Keypress(KeyAscii As Integer)
If KeyAscii = 13 Then a = autentificar(Text1.Text, Text2.Text)
End Sub
__________________
ホルヘ・ラファエル・マルティネス・レオン