Results 1 to 7 of 7
  1. #1
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58

    Restricted Access on Access 2010 Navigation Form

    Good afternoon.

    I've created a Login form for my Access 2010 db which prompts end users for USERID and PASSWORD upon opening the db. When the Login is successful, the Navigation Form is prompted, and I have 7 sub forms within this Navigation form.

    Depending on the type of end user, I'd like to restrict the view of these 7 sub forms. For 'Admins', no restrictions need to be made, all 7 sub forms should be visible. For 'Guest' users, I want to restrict the visibility to 5 sub forms (the other 2 are for data enty on the Admin side)

    I've seen several threads and solutions for code and listboxes, but none for using a 2010 wizard-created Navigation Form w/ Sub forms.



    Any insight on how to go about this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I have never used Navigation form but I suppose could be done. I have done this with the regular Tab control.

    Do you want to provide project for analysis (so I don't have to build a Navigation form)? Follow instructions at bottom of my post.
    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
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58
    Thanks, June.

    I've attached my UAT version of my db. When prompted at the login, select ADMIN and the password is "test123".

    Once in the db, you'll be at the Navigation form and 7 subform tabs are present, including the "Welcome" and "Exit DB" tabs. My goal from the post is when signed in as a GUEST, the ability to view and/or click on the "Enter New Vendor Record" subform tab is not allowed.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Consider using the OpenArgs argument of OpenForm:

    'Close logon form and open navigation screen
    DoCmd.OpenForm "frmNavigation", , , , , , Me.UserName
    DoCmd.Close acForm, "frmLogin", acSaveNo

    Then code in navigation form open event:
    Private Sub Form_Open(Cancel As Integer)
    If Me.OpenArgs <> "Admin" Then
    Me.NavigationButton9.Visible = False
    End If
    End Sub

    The navigation button will not be available and blank space will show in its position.

    A tab control does not leave blank space when tab page is not visible.
    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
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58
    I'll try this, thanks June! Will let you know the outcome.....

  6. #6
    need_help12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    58
    June, this code partially worked. When I logged in as a GUEST, the forms I dont want visbile arent, which is perfect. However when I log in as ADMIN, these forms also arent visible, which is not correct.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Sorry, guess it was a late night.

    Try:
    DoCmd.OpenForm "frmNavigation", , , , , , Me.cmbUserName.Column(1)
    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: 03-08-2012, 03:29 PM
  2. Replies: 3
    Last Post: 01-12-2012, 02:04 PM
  3. Access 2010 DAO Recordsets with navigation
    By d9pierce1 in forum Access
    Replies: 1
    Last Post: 01-12-2012, 09:14 AM
  4. Replies: 3
    Last Post: 11-15-2011, 06:29 PM
  5. Replies: 2
    Last Post: 01-15-2011, 10:56 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