Results 1 to 7 of 7
  1. #1
    RatExcel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    7

    Disable user access to all tables, queries, forms and reports

    Hello,

    I would like to disable user access to all tables, queries, reports and forms except the one form that opens on start.

    I've done a research and the way that comes up most often is to go to File > Options > Current Database and uncheck Use Access Special Keys, Display Navigation Pane, Allow Full Menus and Allow Default Shortcuts Menus. Then the only way to see the Pane and Menus is to hold Shift when opening DB. Let's say that's some kind of a protection because regular user probably don't know that and it's fine by me.

    But in Access 2010 even if you do all that, there still are Privacy Options in File menu. Going there you can check all the options back, reopen the DB and you have full access again. So that's no protecion.

    Is there an option to disable Privacy Options too? I know I can save my DB as .accde file but for some reasons I cannot/don't want to do that. Is there any other way to disable user access? Maybe some VBA code?

    Any help would be really appreciated

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    How about hiding the ribbon using VBA
    Code:
    DoCmd.ShowToolbar "Ribbon", acToolbarNo    'Hides the full toolbar
    DoCmd.ShowToolbar "Ribbon", acToolbarYes   'Show
    



  3. #3
    RatExcel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    7
    Thank you! I think this will work But there is another problem. I would like the form to be opened when DB starts and I want that user to be unable to close it. I managed to achieve it but then I cannot close the DB at all... I know that there is no On DB Close option in Access VBA but a hidden form and On Load and Unload events can be used to simulate this. I've tried use some boolean variant that can be passed to Cancel argument in Unload Event but I can't figure out how to do this properly. It seems that there is no way for Access to know when the Unload event is called because of the form closing or because of DB closing. Any help? Thank you in advance

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I want that user to be unable to close it.
    If the user can't close it, then who else would close it? Explain your thinking on this and how it should work. Explain it to me as if we were standing in line at Starbucks.

  5. #5
    RatExcel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    7
    Ok, so certain form opens up when you open a database. All menus and ribbons are hidden so you can only access this particular form. You should be able to close the database/application ([X] button in the top right corner) but you should not be able to close the form (by using right-click > Close or CTRL + W or the [x] button on form). In other words the only way to close the form is to close the whole database. I want to prevent the user from closing the form (on purpose or by accident) because when all menus and ribbons are hidden there is no way for the user to reopen the form.

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Why not just put a command button on the form that closes Access. In the properties for the form, make sure that the settings do not show the close or minimize or maximize icons. It is on the format section of the properties for the form.

    DoCmd.Quit will shut down Access. Put this code behind the command button.

  7. #7
    RatExcel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    7
    Thank you! I've done it a little bit different but you answer helped me to figute it out.

    I set Form1 to open on DB start and put below code in Unload event of this form:

    Code:
    Private Sub Form_Unload(Cancel As Integer)
        
        msg = "Closing this form will close whole database!" & vbCrLf & vbCrLf & "Are you sure?"
        
        If MsgBox(msg, vbYesNo + vbInformation, "Info") = vbNo Then
            Cancel = True
            Exit Sub
        End If
        
        DoCmd.SetWarnings False
        DoCmd.Quit
        DoCmd.SetWarnings True
        
    End Sub

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

Similar Threads

  1. How to show Forms\reports\queries
    By stenman in forum Programming
    Replies: 3
    Last Post: 09-17-2013, 04:56 AM
  2. Replies: 1
    Last Post: 03-08-2012, 08:34 AM
  3. reports to forms to queries
    By aaa1 in forum Forms
    Replies: 9
    Last Post: 08-10-2011, 07:29 PM
  4. 2010 and 2007 Access Queries, Forms & Reports
    By rpaldridge in forum Import/Export Data
    Replies: 3
    Last Post: 02-11-2011, 07:37 AM
  5. Queries, Forms, Reports..
    By groundhog in forum Access
    Replies: 3
    Last Post: 07-07-2010, 12:30 PM

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