Need to reset Password Form - Help please!

Jk45

Registered User.
Local time
Today, 00:44
Joined
Oct 22, 2007
Messages
12
Hi, I'm quite new to Databases, but am learning fast. I have currently made a database, for a Movie Rental Store (not a real one), but have now come to a halt.

My problem is that I have created two tables in which, 1 one them I have a log of Staff names, passwords and Dates. In the other table I have got the actual Staff Username and Password.

From these two tables, I have made a Form, in which I have a command button, which uses the following On-Click [Event Procedure] Code:

Private Sub Command12_Click()
On Error GoTo Err_Login_Click

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

DoCmd.OpenForm "Edit_Films"

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

Forms!frmlogin.Visible = False

Exit_Login_Click:
Exit Sub

Err_Login_Click:
MsgBox Err.Description
Resume Exit_Login_Click
End Sub

This all works fine, and when I log in correctly, it takes me to another Form, in which I can Edit Films. My problem is though, that when I have logged in, and I come out of the Form (Working on a Switchboard), and then re-enter the Login Form, the Username and Password info is still there. I have tried to use Reset Command Macros on Fields and more, but with no success.

Obviously I don't want the info to be there, so anyone can just login using the details there.

If anyone knows how to Reset the info on the Form, it would be a great help.

Also, when the Form is incorrectly typed, the WHOLE programme exits, and I only want it to re-enter the Login Form. I am using the Code as mentioned above. Again, if anyone can help, I would be very grateful.

All thanks

Jordan
 
Last edited:
you need to assign null values to your password form controls to clear the values. Also if the user enter a wrong passwork it closes becuase to the Docmd.Quit
 
Hi Keith. Thanks for the quick reply, I have added to your reputation.

The DoCmd.Quit solution worked, so thankyou VERY much.

My problem, however, is that I am not sure what you mean about:

"you need to assign null values to your password form controls to clear the values"

I go onto the password properties, but am not sure if I go onto Contol Source etc. and what I do from there.

Thanks

Jordan
 
Actualy why not just close the password form?
 
Hi Keith. I am not sure closing the password form would work.

I have a Switchboard, in which I follow the steps:

Member > Edit Member - Now the Login Form Opens - (If typed correctly), a Macro goes to Edit_Member Form

So when I have finished with the Edit_Member Form, and go back to the Password Form, the Username and Password is still there.

Hope that explains it more

Thanks again

Jordan
 
Last edited:

Users who are viewing this thread

Back
Top Bottom