Public Sub loginbtn_Click()
If IsNull([usernamecbo]) = True Then
MsgBox "Username is required", vbOKOnly, "Required Data"
ElseIf IsNull([passwordtxt]) = True Then
MsgBox "Password is required", vbOKOnly, "Required Data"
Else
If Me.passwordtxt.Value = DLookup("PASSWORD", "SYS_USER", "[SERIAL_NUMBER] = " & Me.usernamecbo.Value) Then
strUser = Me.usernamecbo.Value
strAccountType = DLookup("USER_TYPE", "SYS_USER", "[SERIAL_NUMBER] = " & Me.usernamecbo.Value)
DoCmd.Close
MsgBox "Welcome Back, " & strAccountType, vbOKOnly, "Welcome"
DoCmd.OpenForm "First Screen"
Else
MsgBox "Invalid Password. Please try again.", vbOKOnly, "Invalid Password"
passwordtxt.SetFocus
End If
End If
End Sub
This is a Code That Search in data base for related records to be able to log in to system and it all works great.
the question is, if i want to make the user can modify his password, how can this be done.
thanks in advance :)