Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!
Private Sub cmdLogin_Click() Dim dbs As Database Dim rstUserPwd As Recordset Dim bFoundMatch As Boolean Set dbs = CurrentDb Set rstUserPwd = dbs.OpenRecordset("qryUserPwd") bFoundMatch = False If rstUserPwd.RecordCount > 0 Then rstUserPwd.MoveFirst ' Check for matching records Do While rstUserPwd.EOF = False If rstUserPwd![UserName] = Form_frmLogin.txtUserName.Value And rstUserPwd![Password] = Form_frmLogin.txtPassword.Value Then bFoundMatch = True Exit Do End If rstUserPwd.MoveNext Loop End If If bFoundMatch = True Then ' Open the next form here and close this one DoCmd.Close acForm, Me.Name DoCmd.OpenForm "frmMainMenuAdmin" 'Change this to the switchboard form name' Else MsgBox "Incorrect Username or Password" End If rstUserPwd.Close End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.