KSReynolds
New Member
- Joined
- Aug 20, 2013
- Messages
- 2
I have written a database in Access 2000 for a client. When it is copied to the Access 2000 machines, it runs fine. When it is copied to an Access 2010 machine, the logon form opens, but after the user enters in his login, nothing happens. No error message, just dead air. The after update of the password on the frm_login is
Private Sub txtPassword_AfterUpdate()
'Check to see if data is entered into the UserName combo box
Dim FirstName As String, LastName As String
If Len(Me.cboEmployee & "") = 0 Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If Len(Me.txtPassword & "") = 0 Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tbl_UserAccess to see if this matches the value chosen in combo box
'DoCmd.Hourglass True
If Me.txtPassword.Value = DLookup("UserPassword", "tbl_UserAccess", "[UserName]= '" & Me.cboEmployee.Value & "'") Then
gbl_User = Me.cboEmployee.Value ' pass the username to the global user variable
'if the mainform is aleady open then close it before reopening.
DoCmd.OpenForm "frmSwitchboard1" ' Open the main form
Forms![frmSwitchboard1].LogonName = Me.cboEmployee
DoCmd.Close acForm, "frm_Logon" 'close the log on form
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
Me.txtPassword = ""
'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!"
Application.Quit
End If
DoCmd.Hourglass False
End If
DoCmd.Hourglass False
End Sub
Can anyone understand why this code just does not appear to run?
Private Sub txtPassword_AfterUpdate()
'Check to see if data is entered into the UserName combo box
Dim FirstName As String, LastName As String
If Len(Me.cboEmployee & "") = 0 Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If Len(Me.txtPassword & "") = 0 Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tbl_UserAccess to see if this matches the value chosen in combo box
'DoCmd.Hourglass True
If Me.txtPassword.Value = DLookup("UserPassword", "tbl_UserAccess", "[UserName]= '" & Me.cboEmployee.Value & "'") Then
gbl_User = Me.cboEmployee.Value ' pass the username to the global user variable
'if the mainform is aleady open then close it before reopening.
DoCmd.OpenForm "frmSwitchboard1" ' Open the main form
Forms![frmSwitchboard1].LogonName = Me.cboEmployee
DoCmd.Close acForm, "frm_Logon" 'close the log on form
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
Me.txtPassword = ""
'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!"
Application.Quit
End If
DoCmd.Hourglass False
End If
DoCmd.Hourglass False
End Sub
Can anyone understand why this code just does not appear to run?