Password protect a form

O

oxicottin

Hello, I am trying to password protect my opening form and log the
information. It works great but one thing. When I close the database and
reopen I get the Log In form and the last password and log In name is still
there. How do I get it to be empty evertime I open my database? Do I make a
qry or do I add more code to the LOG IN button? Thanks!!!

On Error GoTo Err_CmdLogin_Click

If [LogStaffLoginName] = DLookup("[StaffLoginName]", "TblStaff",
"[StaffPassword]=forms!frmlogin!LogPasswordEntered") Then

DoCmd.OpenForm "FrmSwitchboard"

Else
Me!LogProblem = -1
DoCmd.Quit
End If

Forms!frmlogin.Visible = False

Exit_CmdLogin_Click:
Exit Sub

Err_CmdLogin_Click:
MsgBox Err.Description
Resume Exit_CmdLogin_Click
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top