Created
January 23, 2018 21:54
-
-
Save jeffreyvr/572ae8ea3ba5692bc10a60e3783ac0d6 to your computer and use it in GitHub Desktop.
Access VBA Login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Compare Database | |
Private Sub LoginBtn_Click() | |
Dim db As DAO.Database | |
Dim rst As DAO.Recordset | |
Set db = CurrentDb | |
Set rst = db.OpenRecordset("select * from dbo_Medewerker where medewerkerloginnaam='" & GebruikersnaamTxt.Value & "'") | |
If rst.RecordCount <= 0 Then | |
MsgBox "Invalide login", vbCritical | |
GebruikersnaamTxt.SetFocus | |
Else | |
If IsNull(PasswordTxt.Value) Or rst("Wachtwoord") <> PasswordTxt.Value Then | |
MsgBox "Invalide wachtwoord", vbCritical | |
PasswordTxt.SetFocus | |
Else | |
DoCmd.Close | |
DoCmd.OpenForm "Inloggen Rapportages" | |
End If | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment