Hello,
I have A login script for an Accessdb.
When a password is wrongly submitted it has to return to the pasword textbox. It Won't go back to the box.
What's wrong?
Private Sub Password_AfterUpdate()
Dim BtnValue As Integer
If IsNull(DLookup("Password", "Gebruikers", "UserName='" & Me.UserName & "'") Then
BtnValue = MsgBox("Verkeerde gebruikersnaam ingevoerd!", vbExclamation + vbOKOnly, "Gebruikersnaam"
If BtnValue = vbOK Then DoCmd.GoToControl "UserName"
Else
If DLookup("Password", "Gebruikers", "UserName='" & Me.UserName & "'" <> Me.Password Then
MsgBox "Invallid Password"
Me.Password = Null
DoCmd.GoToControl "Password"
Else
DoCmd.OpenForm "Switchboard", acNormal, , , , acWindowNormal
DoCmd.Close acForm, "Login", acSaveNo
End If
End If
End Sub
I have A login script for an Accessdb.
When a password is wrongly submitted it has to return to the pasword textbox. It Won't go back to the box.
What's wrong?
Private Sub Password_AfterUpdate()
Dim BtnValue As Integer
If IsNull(DLookup("Password", "Gebruikers", "UserName='" & Me.UserName & "'") Then
BtnValue = MsgBox("Verkeerde gebruikersnaam ingevoerd!", vbExclamation + vbOKOnly, "Gebruikersnaam"
If BtnValue = vbOK Then DoCmd.GoToControl "UserName"
Else
If DLookup("Password", "Gebruikers", "UserName='" & Me.UserName & "'" <> Me.Password Then
MsgBox "Invallid Password"
Me.Password = Null
DoCmd.GoToControl "Password"
Else
DoCmd.OpenForm "Switchboard", acNormal, , , , acWindowNormal
DoCmd.Close acForm, "Login", acSaveNo
End If
End If
End Sub