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
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: