Unanswered: Help: Login to specific record on form
I have been trying for weeks to get my login form to open up to a specific record on the mainform. I have built a form out of my Employee tbl (mainform). The table stores (ID,Name, password, EmpNumber ect.) I built a subform in that allows the user to type in the number of overtime worked on a paticular day. I have disabled the navigation on the main form so users can't advance to the next user but have enable the natigation on the subform so a particular user can advance to the next week of available overtime to input data.
I am attaching the file. The goal is to get user login form to display a particular record on the main form and open a different form in the user is a supervisor.
Option Compare Database
Private intLogonAttempts As Integer
Private Sub cmdExit_Click()
Private Sub cmdLogin_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
'Check value of password in tblEmployees to see if this matches value chosen in combo box
If Me.txtPassword.Value = DLookup("EmpPassword", "tblEmployeesLog", "[EmpID]=" & Me.cboEmployee.Value) Then
MyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database. Please contact your system administrator.", vbCritical, "Restricted Access!"
I'm having the same problem you had. I want to make a login form that will open a form with a specific record. Can you post the sample of your login form so that I can check on how you made it work? Thanks so much.