Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35
  1. #31
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by Minty View Post
    That's because I can't type.

    It should be
    Dim iAccessLvl as Integer
    getting a 2450 error says it cant reference loginform

  2. #32
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Is the form open? It will need to be.

    If not, as an alternative why not save the person whose has logged in to a local table, and look that up?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #33
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by Minty View Post
    Is the form open? It will need to be.

    If not, as an alternative why not save the person whose has logged in to a local table, and look that up?
    I thought the code went into every form in the on load args is this correct?

    inserted it into the LoginForm on load args and get run time error - didn't think it went hear though just trying things out.

    how do you mean by save person in to a local table? so that when someones logged in, it records the user to a table...

    that would be helpful I guess but would that help the AccesslevelID problem?

    the code I have working was in afterupdate I have created a login button and entered the code to use button - all works fine but when but when all forms close and login form is reopened the user and password can still be re-used hense not logged out any ideas?

    Private Sub cmdEnter_Click()
    'Check that EE is selected
    If IsNull(Me.cboUser) Then
    MsgBox "You need to select a user!", vbCritical
    Me.cboUser.SetFocus
    Else
    'Check for correct password
    If Me.txtPassword = Me.cboUser.Column(2) Then
    'Check if password needs to be reset
    If Me.cboUser.Column(3) = True Then
    DoCmd.OpenForm "PasswordChange", , , "[EmployeeID_PK] = " & Me.cboUser
    End If
    DoCmd.OpenForm "CabinetTech"
    Me.Visible = False
    Else
    MsgBox "Invalid Password!", vboOkOnly
    Me.txtPassword = Null
    Me.txtPassword.SetFocus
    End If
    End If
    End Sub

    Private Sub Form_Load()
    Me.cboUser.SetFocus
    End Sub

  4. #34
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    My suggestion if you want to store this is to have a local table - call it tblLocalSystem
    Its a one row table with the current user details and any other local information stored.
    Make the first field your RowID and set it as primary key, value 1 . Have a field called CurrUserID, and store the logged in user ID to this field, empty it on exiting the database.

    You can then lookup this value to determine their access levels etc.
    Don't store it on the login form entry boxes - simply clear those out when they have correctly logged in.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #35
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by Minty View Post
    My suggestion if you want to store this is to have a local table - call it tblLocalSystem
    Its a one row table with the current user details and any other local information stored.
    Make the first field your RowID and set it as primary key, value 1 . Have a field called CurrUserID, and store the logged in user ID to this field, empty it on exiting the database.

    You can then lookup this value to determine their access levels etc.
    Don't store it on the login form entry boxes - simply clear those out when they have correctly logged in.
    cheers for that Minty I managed to sort it out and have it working... what Ive done is created log out buttons on each page as well as back buttons, the log out buttons simply closes all forms even login form and then reloads which clears the user and password.

    took me some time but got there, I need to code the forms individually but its only 6-7 lines so that's fine i don't mind the experience lol

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Runtime error 3464
    By gunterbrink in forum Programming
    Replies: 15
    Last Post: 12-29-2016, 07:58 PM
  2. Syntax Error 3464 Need help
    By draalderks in forum Forms
    Replies: 13
    Last Post: 06-09-2015, 10:11 AM
  3. error 3464 - Password change form
    By Sheba in forum Forms
    Replies: 14
    Last Post: 10-14-2014, 11:48 AM
  4. Execution error 3464
    By Trisha in forum Access
    Replies: 3
    Last Post: 03-03-2014, 01:03 PM
  5. 3464 error received
    By TEN in forum Programming
    Replies: 10
    Last Post: 07-08-2009, 07:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums