I have a logon form that checks user id and password, once you click the login button a new form should open called "frmWelcome" and the "logon" form should close.The problem is that when a users password is authenticated the welcome form opens but the logon form does not close behind it. I would appreciate any suggestions as to how to overcome this problem.I will attach the code causing the problems, thank you in advance.
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", _
"tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open welcome screen
DoCmd.Close acForm, "Logon", acSaveNo
DoCmd.OpenForm "frmWelcome"
Else
MsgBox "Password Invalid. Please Try Again", _
vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("strEmpPassword", _
"tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then
lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open welcome screen
DoCmd.Close acForm, "Logon", acSaveNo
DoCmd.OpenForm "frmWelcome"
Else
MsgBox "Password Invalid. Please Try Again", _
vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If