Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Posts
    102

    Unanswered: Using a form to change password?

    I used Access built in Security Wizard to create usernames and password and save it as my own workgroup. Now is it possible to create a form which the user can use to change their passwords, rather than going to the Tools Menu and clicking on Security and one of the options there. Because I'm planning to hide the menu toolbar later on so they can't access any options besides the toolbars I provided them. If it's possible to change the user's password, how can this be done by using a form?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yes its perfectly poosible to write your own password changinf form, but you can just as easily run the standard Access password / user dialog using
    Code:
    DoCmd.RunCommand acCmdUserAndGroupAccounts
    In an MDE app,personally I prefer to offer both based on an individuals privileges - if if they are a member of the application admin then they see the Access dialog, if they don't then they see a simple password change form
    Attached Files Attached Files

  3. #3
    Join Date
    Jun 2005
    Posts
    102
    Thanks Healdem, that really helped out. Another question, how can I limit a group from accessing a form. For example, I don't want Read-Only users in the workgroup to access this form. Is there a code that looks like the code below.

    Private Sub Form_Open()
    If CurrentGroup = ReadOnlyUsers Then
    MsgBox "No Access"
    Else
    DoCmd.Something
    End If
    End Sub

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yes its another chunk of generic code, some stolen from Dev Ashish

    the function you are looking for is something like haspermission(<group>)

    this particular version uses the access currentuser() function to set the userid but you could quite easily change that to use the network logon

    personally I don't try to assign group permissions to objects

    How you deploy the return form thr fucntion is up to you, i have used
    <cmdbutton>.enabled=haspermission(<mygroup>)
    <cmdbutton>.visible=haspermission(<mygroup>)

    or
    booStateFlag=haspermission(<mygroup>)
    <cmdbutton1>.visible=boostateflag
    <cmdbutton2>.visible=boostateflag
    <cmdbutton..>.visible=boostateflag
    <cmdbuttonn>.visible=boostateflag
    if there are many to set witht the same value

    i've also used
    <cmdbutton1>.visible= NOT (boostateflag)

    I also tend to put some code in the load / opn events to query of that form / report is visible to a specified user and chuck 'em out (set the cancel flag) if they don't have permission

    HTH
    Attached Files Attached Files

  5. #5
    Join Date
    Jun 2005
    Posts
    102
    Hey thanks a lot, Healdem! It works. Yay!!!

Posting Permissions

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