Results 1 to 3 of 3
  1. #1
    Join Date
    May 2013
    Posts
    1

    Red face Unanswered: Cannot log into MS access database after log in

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

    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.

    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
    Last edited by Accessgirldefined; 05-15-13 at 00:59. Reason: more information

  2. #2
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Please post a copy of the database with the relevant tables, forms etc. that are used to login into the database including the forms that will be displayed after a successful login etc.

    I will have a look at it after you post the database to the forum.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd suggest you step through the code
    put a break point / watch on the OLEUnbound59 function call

    then press f8 to step through line by line.
    make certain the code is doing what you expect


    .but after clicking on to button to log me in..nothing happens ...not sure whats wrong.
    isn't really enough to go on for us to help


    also when posting code snippets please make certain tha yopu use the [ c o d e ] and [ / c o d e ] tags (minus the spaces ie [ / c o d e ] becomes [/code]
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •