you can skip this by just using Window Login authentication.
Their windows login/password is the same used for the access db.
Keep the userID table as the list of users allowed to be in the db, but no need to keep passwords.
Code:
SUB btnLogin_Click()
Dim sUser As String, sPass As String, sDom As String
sUser = txtUser
sPass = txtPass
sDom = "CoDomain"
if sUser = Dlookup("userid","tUsers","[userid]='" & sUser & "'") then
If WindowsLogin(sUser, sPass, sDom) Then
mbSafe = True
DoCmd.OpenForm "frmMainMenu"
DoCmd.OpenForm "frmLogin"
DoCmd.Close
Else
MsgBox "LOGIN INCORRECT", vbCritical, "Bad userid or password"
End If
end if
end sub
'-----------------
Public Function WindowsLogin(ByVal strUserName As String, ByVal strpassword As String, ByVal strDomain As String) As Boolean
'-----------------
'Authenticates user and password entered with Active Directory.
On Error GoTo IncorrectPassword
Dim oADsObject, oADsNamespace As Object
Dim strADsPath As String
strADsPath = "WinNT://" & strDomain
Set oADsObject = GetObject(strADsPath)
Set oADsNamespace = GetObject("WinNT:")
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strDomain & "\" & strUserName, strpassword, 0)
WindowsLogin = True 'ACCESS GRANTED
ExitSub:
Exit Function
IncorrectPassword:
WindowsLogin = False 'ACCESS DENIED
Resume ExitSub
End Function