Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    178

    Unanswered: how to record a user that has login

    ok once I have a person login to the system how do I keep a local record of their user name and the access level because I don't want them to open some forms depending on their access level and also sometimes I might only want them to view information and not edit or add.

    Thanks

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    I would have a table of users and their login id, pass, and SecLevel.
    When the db opens I load user data to a collection (or Class)

    Then when the form opens turn on/off boxes accordingly.
    txtPermit.locked = gcolUser("IsAdmin") = "N"
    etc..

    Code:
    Public gcolUser As Collection
    
    Sub getUserSettings(ByVal pvID)
    Dim sSql As String
    Dim rst
    
    Set gcolUser = New Collection
    sSql = "select * from tUsers where [userId] = '" & pvID & "'"
    Set rst = currentdb.openrecordset(sSql)
    
    With rst
       gcolUser.Add "UserID", .Fields("UserID").Value & ""
       gcolUser.Add "Name", .Fields("Name").Value & ""
       gcolUser.Add "pass", .Fields("pass").Value & ""
       gcolUser.Add "SecLevel", .Fields("SecLevel").Value & ""
       gcolUser.Add "IsMaint", .Fields("IsMaint").Value 
       gcolUser.Add "IsAdmin", .Fields("IsAdmin").Value 
    End With
    Set rst = Nothing
    End Sub

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    personally I'd pul the network logon from the API call be dev ashish...
    ... but then Im a lazy begger, I hate to write code that I have to develop, test and support when there is perfectly viable code maintained by someone else....
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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