I made some little corrections here in the coding:
Private Sub Log_In_Click()
Static intTries As Integer
If IsNull(DLookup("[username]", "Cuentas Usuarios", "[username] = '" &
Forms!Cuentas_Usuarios!username.Text _
& "' And [password] = '" & Forms!Cuentas_Usuarios!password.Text &
"'")) Then
If intTries = 3 Then
MsgBox "Lo sentimos,usted no tiene acceso al sistema. Cualquier
duda o problema, comuníquese con Joann a la ext. 1750"
DoCmd.Quit
Else
If MsgBox("Nombre y/o contraseña inválida.", vbRetryCancel +
vbDefaultButton2, "login Error") = vbCancel Then
DoCmd.Quit
Else
intTries = intTries + 1
Forms!Cuentas_Usuarios!username.Text.SetFocus
End If
End If
Else
MsgBox "Bienvenido a Modificar ISA."
DoCmd.OpenForm "Modificar ISA"
DoCmd.Close acForm, Me.Name, acSaveNo
End If
End Sub
I got corrected the If...then statement, but now another error appears. The
error says:
"Run-time error '2450':
Impact Safety Analysis can't find the form 'Cuentas Usuarios' referred to in
a macro or Visual Basic code."
Impact Safety Analysis is the name of my database, just in case you don't
know what it is.
What's missing in the coding that I should add to make it work?
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...dules/200603/1