Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2015
    Posts
    4

    Unanswered: Total hack needs help with user access restrictions

    First off I am a total hack. I have hacked my way through the Microsoft Access Project Management Template so far to the point that I have added a user drop down menu, which then requires a password. This part works but right now I do not have a form selected to open once the user enters the correct password.

    All the users, which will be entered into the employee list, will get assigned tasks to a particular project and will have their own login. When they login I need them to only see tasks that are assigned to them. This is the point I need to get to first. Once I have this figured out I want that employee to be able to enter the number of units they have produced and it will update their task.

    Hopefully that makes sense. As stated the first step is showing only the records for the person signing in. I would think its possible since the table being used for the user login / password is the same table that is used to pick uses for tasks.

    Any help appreciated.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    best solutin to that issue
    use their network logon as the internal userid inside yiour system

    use the network API calls, documented by dev ashish (google dev ashish api) to find out who the user is (as opposed to who the user claims to be

    then use that neam inside youyrsystem as and when required


    you may need to refine the design by desigininbg some approiach that lets a user (network logon) to see other suers data and or perfomr other tasks
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2015
    Posts
    4
    Quote Originally Posted by healdem View Post
    best solutin to that issue
    use their network logon as the internal userid inside yiour system

    use the network API calls, documented by dev ashish (google dev ashish api) to find out who the user is (as opposed to who the user claims to be

    then use that neam inside youyrsystem as and when required


    you may need to refine the design by desigininbg some approiach that lets a user (network logon) to see other suers data and or perfomr other tasks
    Thanks for that info. The reason I want to go with individual logins into access is because of the number of employees. They need to be able to login, input data and then be out of the way for the next person. I think there are to many employees to have each one have a windows account. I already have the login part done. Just need to know how to limit viewing to tasks for the currently logged in employee.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    What i do is have a Login in form once they log in I HIDE that form and then i reference that form.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Aug 2015
    Posts
    4
    Quote Originally Posted by myle View Post
    What i do is have a Login in form once they log in I HIDE that form and then i reference that form.
    That is where my problem is. Like I said I have hacked my way to this point using VB Code I found online and then figuring out what does what and what to change to make it work. Here is the code for the submit button on my password form.

    Private Sub cmdLogin_Click()

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

    If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" 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 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("Password", "Employees", _
    "[ID]=" & Me.cboEmployee.Value) Then

    ID = Me.cboEmployee.Value

    'Close logon form and open splash screen


    DoCmd.OpenTable "Tasks", FilterName:=" ???"
    DoCmd.Close acForm, "Employee_Login"", acSaveNo"

    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 admin.", _
    vbCritical, "Restricted Access!"
    Application.Quit
    End If

    End Sub

    It works up to the part where they enter password correctly and I have it opening a table and am attempting to use a filter to show only records that contain the name of the current login. I don't know what to do if its possible in the same code. The rest of the code where it suppose to close the login form and login attempt fails does not seem to work.

  6. #6
    Join Date
    Aug 2015
    Posts
    4
    I changed the document being opened on successful login to a form..

    DoCmd.OpenForm "Task Details"

    It pulls up the assigned task form but still need to limit the records shown to match the person that is logged in. I think I'm really close but maybe not.

    I do need to lock the form down a bit so that the employee can only change 1 field, which will be number of units they produced that day.
    Last edited by Rick James Bish; 08-19-15 at 20:28.

Posting Permissions

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