Results 1 to 6 of 6
  1. #1
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143

    Question user security access 2013 for switchboard items

    I have user security level setup with username and password
    I have set forms and tables etc to security levels
    what i am having trouble with is setting user security levels to command buttons on the switchboard.
    Example if you sign in Mary Jones
    and you click on the command button (open Tom Smith switchboard) button on the main switchboard and your not tom smith you get a message access denied.
    Code:
    Private Sub Form_Open(Cancel As Integer)
    If Forms!frmLogin!cboUser.Column(4) <> 2 Then
    MsgBox "you cant open this form"
    Cancel = True
    DoCmd.OpenForm "TomsSwitchboard"
    Me.Visible = False
    End If
    End Sub
    Error; Tom's switchboard is not a form
    it is a switchboard page. and putting CoCmd.OpenSwitchboardPage that does not work either..

    when you look at the event on click of the command button a macro opens up but I dont see how you can edit it.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I would disable the command button if Tom is not the user so they don't even get to the point of opening switchboard.

    By 'switchboard' do you mean a form built by the switchboard wizard? Don't like it, never used it. There is good reason it has been deprecated.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    yes it is switchboard manager. so you would build all the switchboard forms from scratch?
    what code would you use to disable the button?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, from scratch with VBA, not macros.

    Possibly in the main menu form Open event, something like:

    If Me.User <> "Tom" Then Me.buttonname.Visible = False
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    What I did was on open put the code

    Private Sub Form_Open(Cancel As Integer)
    If Forms!frmLogin!cboUser.Column(4) <> 3 Then
    MsgBox "you cant open this form"
    Cancel = True
    Form_Leslie.AllowDeletions = False
    Form_Leslie.AllowEdits = False
    Form_Leslie.AllowAdditions = True
    End If
    End Sub
    The user table is not just 4 levels of security
    each entry is one of the users and there are 7 users and each has different levels of security I am creating

    so if column (4) = 1
    then it is Mary that signed in
    what I am trying to do is make this one step
    so If column(4) is = to 1 or 4 then both users 1 and 4 can open the form and enter additions.
    Can you help? not sure how to accomplish this.
    Thanks

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't understand the structure so is hard for me to advise specifics.

    I don't build different forms for different users. I build forms to meet a process requirements, not separate forms tailored to individual user.

    I have one 'login' form and one MainMenu form for all users. I use code to manage what controls on form are available to users. If I don't want 'staff' users access to button A then I disable that button. Why allow user to initiate opening a form if they should not use that form?

    User should not be able to get to objects in navigation pane.
    Last edited by June7; 08-05-2015 at 12:54 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-19-2015, 09:04 AM
  2. Replies: 3
    Last Post: 04-29-2015, 01:35 PM
  3. Replies: 13
    Last Post: 11-18-2013, 02:20 PM
  4. Access user security level
    By tsv_tech in forum Access
    Replies: 2
    Last Post: 07-25-2012, 11:08 PM
  5. Access User Security
    By KkcBroad50s in forum Security
    Replies: 3
    Last Post: 04-29-2011, 09:31 AM

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