Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Cannot log into MS access database after log in

$
0
0
Hi,

I'm currently working a new project and have been given the MS access database that someone had built and now left the company. I'm just learning MS Access...:angel:

I can't seem to log into the database. BTW this is a 2000 mdb file and I'm using MS access 2007.

After the initial login form, I can select my username and then enter my password ...but after clicking on to button to log me in..nothing happens ...not sure whats wrong. :eek:

here's the code for the button (login button)

Private Sub OLEUnbound59_Click()

'Check to see if data is entered into the UserName combo box

If IsNull(Me.CboEmployee2) Or Me.CboEmployee2 = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.CboEmployee2.SetFocus
Exit Sub
End If

'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"
Me.txtPassword.SetFocus
Exit Sub
End If

'Check value of password in tblEmployees to see if this matches value chosen in combo box

If Me.txtPassword.Value = DLookup("strEmpPassword", "tblBroker", "[BrokerID]=" & Me.CboEmployee2.Value) Then

BrokerID = Me.CboEmployee2.Value
DoCmd.OpenForm "FrmRapid", acNormal


'Hide logon form and open splash screen
Me.Visible = False

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmApplicationInitial"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If


'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

End Sub

Private Sub Label16_DblClick(Cancel As Integer)
ChangeProperty "AllowBypassKey", dbBoolean, True
End Sub

Private Sub OLEUnbound63_Click()

DoCmd.Requery

'Check to see if data is entered into the UserName combo box

If IsNull(Me.CboEmployee2) Or Me.CboEmployee2 = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.CboEmployee2.SetFocus
Exit Sub
End If

'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"
Me.txtPassword.SetFocus
Exit Sub
End If

'Check value of password in tblEmployees to see if this matches value chosen in combo box

If Me.txtPassword.Value = DLookup("strEmpPassword", "tblBroker", "[BrokerID]=" & Me.CboEmployee2.Value) Then

BrokerID = Me.CboEmployee2.Value
'TeamID = DLookup("Team", "tblBroker", "[BrokerID]=" & Me.CboEmployee2.Value)
DoCmd.OpenForm "FrmRapid", acNormal



'Hide logon form and open splash screen
Me.Visible = False

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmApplicationInitial"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If


'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

End Sub

Viewing all articles
Browse latest Browse all 13329

Trending Articles