Hide Access Options
Asked Answered
K

5

9

I have noticed that even though when you disable the “Use Access Special Keys”, disable the “Display Navigation Pane”, and disable the ribbon menus, you can easily access the “Access Options” go to the current Database area, and re-enable all these options.

Is there a way to completely hide the “Current Database” option in Access 2007 and 2010?

Kowalczyk answered 26/10, 2011 at 18:35 Comment(6)
How far do you want to go? It is possible to completely lock yourself out of changing options etc in a database by disallowing everything including the shift key.Clingfish
See #7683716Clingfish
I already have an Access Application that edits the database property "AllowBypassKey", so the Shift key doesn't work. I just want to be able somehow to also disable the "current database" option window.Kowalczyk
If you uncheck Allow Full Menus under Options->Current Database the user will not have access to Options.Clingfish
Under Access 2010, if you select Privacy Options by clicking on the Orb, you get access to "Current Database" options. Under Access 2007, you click the drop down arrow on the top of the window, where it says "Customize Quick Access Toolbar", then "More Options...", I get access to "Current Database".Kowalczyk
"Allow Full Menus" is unchecked.Kowalczyk
C
14

In MS Access 2007 and MS Access 2010, rather than setting options to control a user's access to the application, it is possible to control the contents of the "Backstage". All images and instructions apply to Access 2010, but 2007 is not very different. Read Customize the Ribbon first.

Backstage

enter image description here

First, right-click the Navigation Bar at the top of the Navigation Pane, and then click Navigation Options on the shortcut menu. In the Navigation Options dialog box, under Display Options, select the Show System Objects check box, and then click OK. This will allow you to see the table you create. Note that is applies to all databases, so you may wish to switch it back off when you are finished.

Next, under Options, choose Client Settings and scroll down to General. You will see Show add-in user interface errors, make sure it is selected.

You will need a table called USysRibbons:

Create Table USysRibbons (ID Counter Primary Key, 
                          RibbonName Text(255),RibbonXml Memo)

You might like to add a unique index to RibbonName, otherwise you could end up with more than one ribbon with the same name.

You will need some XML, you can just cut and paste into the newly created table.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="FileSave" visible="false"/>
   <button idMso="SaveObjectAs" visible="false"/>
   <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
   <button idMso="FileOpen" visible="false"/>
   <button idMso="FileCloseDatabase" visible="false"/>
   <tab idMso ="TabInfo" visible="false"/>
   <tab idMso ="TabRecent" visible="false"/>
   <tab idMso ="TabNew" visible="false"/>
   <tab idMso ="TabPrint" visible="false"/>
   <tab idMso ="TabShare" visible="false"/>
   <tab idMso ="TabHelp" visible="false"/>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
   <button idMso="FileExit" visible="false"/>
  </backstage>
</customUI>

Set the Ribbon Name to say, "BackstageCustom". It should be fairly obvious which line relates to which part of the Backstage.

You now have to close and reopen the database (Compact & Repair is probably the quickest way to do this, but make sure you have a backup before you use this method). There will be a lot of opening and closing in this.

You can now go to Options->Current Database and scroll down to Ribbon and Toolbar Options, select the newly created ribbon under Ribbon Name. When you close Options, you will get a warning that you must close and open the database for the changes to take effect.

When you do, you will no longer be able to see Options on the backstage, nor will you see much except a list of recent databases. Look at the XML above, you can see that everything is set to false.

I reckon the easiest way out of the situation is to open the USysRibbons table and change this line:

<button idMso="ApplicationOptionsDialog" visible="false"/>

to

<button idMso="ApplicationOptionsDialog" visible="true"/>

Open and close again, and remove the ribbon from Ribbon Name, under Options. Open and close and you are back to where you started, more or less.

Clingfish answered 27/6, 2012 at 13:52 Comment(4)
This works great with Access 2007, but in the “Customize Quick Access Toolbar” down arrow, I can access “More Commands…” and have access to Access Options and thus Current Database. In Access 2010, under File, I have “Privacy options which” leads me directly to Access Options as well as “More Commands…”.Kowalczyk
You can change start from scratch to true, which should render the app useless unless you ensure you have additional ribbons. It is a very large subject. All the ribbons can be customized, AFAIK. See also accessribbon.de/en/?Access_-_Ribbons:Ribbon_XML___Controls:QAT.Clingfish
Just a note to future readers - <ribbon startFromScratch="true"> will stop the quick access toolbar from working as well (which may be desireable). It took me a while to figure this out. Great answer @Remou.Manteau
Another note to future readers: Access 2013 has different options in the FILE menu so the XML needs to be slightly modified. I posted it as an answer so I can properly format the code.Corsetti
C
1

To add to Fionnuala's excellent answer, Access 2013 has different options in the FILE menu so the XML needs to be slightly modified. Follow the answer exactly but replace the XML with this, which hides the Options menu and leaves Print and Exit.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
  </backstage>
</customUI>
Corsetti answered 23/6, 2016 at 15:20 Comment(0)
P
1

All,

I've spent a lot of time ... on a lot of websites ...

Here's XML that will:

  • Disable QAT
  • Disable "Database Options"
  • Disable "Save As"
  • Disable "Close" (so you can programmatically control what happens)
  • Enable only the "Home" TAB ... I actually rebuilt it from scratch

This code pretty much "exactly" looks like the standard "HOME" tab in MS Access 2013.

You can use this to really lock down your app ... in combination with some good code to disable special keys at startup, etc.

Here ya go:

   <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="true">
       <!-- Ribbon XML -->
       <tabs>
           <tab id="dbCustomHome" label="HOME" visible="true">
           <group id="dbViews" label="Views">
                   <control idMso="ViewsSwitchToDefaultView" size="large" label="View" enabled="true"/>
               </group>
           <group id="dbClipboard" label="Clipboard">
                   <control idMso="PasteSpecial" size="large" label="Paste" enabled="true"/>
           <control idMso="Cut" label="Cut" enabled="true"/>
                   <control idMso="Copy" label="Copy" enabled="true"/>
                   <control idMso="FormatPainter" label="Format Painter" enabled="true"/>
               </group>
           <group id="dbSortFilter" label="Sort and Filter">
                   <control idMso="FiltersMenu" size="large" label="Filter" enabled="true"/>
           <control idMso="SortUp" label="Ascending" enabled="true"/>
                   <control idMso="SortDown" label="Descending" enabled="true"/>
                   <control idMso="SortRemoveAllSorts" label="Remove Sort" enabled="true"/>
                   <control idMso="SortSelectionMenu" label="Selection" enabled="true"/>
                   <control idMso="FilterAdvancedMenu" label="Advanced" enabled="true"/>
                   <control idMso="FilterToggleFilter" label="Toggle Filter" enabled="true"/>
               </group>
           <group id="dbRecords" label="Records">
                   <control idMso="DataRefreshAll" size="large" label="Refresh All" enabled="true"/>
           <control idMso="GoToNewRecord" label="New" enabled="true"/>
                   <control idMso="RecordsSaveRecord" label="Save" enabled="true"/>
                   <control idMso="Delete" label="Delete" enabled="true"/>
                   <control idMso="RecordsTotals" label="Totals" enabled="true"/>
                   <control idMso="SpellingAccess" label="Spelling" enabled="true"/>
                   <control idMso="RecordsMoreRecordsMenu" label="More" enabled="true"/>
               </group>
           <group id="dbFind" label="Find">
                   <control idMso="FindDialog" size="large" label="Find" enabled="true"/>
           <control idMso="ReplaceDialog" label="Replace" enabled="true"/>
                   <control idMso="GoToMenuAccess" label="Go To" enabled="true"/>
                   <control idMso="SelectMenuAccess" label="Select" enabled="true"/>
               </group>
           <group id="dbTextFormat" label="Text Formatting" centerVertically="true">
            <box id="TopBx">
                       <control idMso="Font" enabled="true"/>
               <control idMso="FontSize" enabled="true"/>
               <buttonGroup id="buttonGroup_TopRow">
                           <control idMso="Bullets" enabled="true"/>
                           <control idMso="Numbering" enabled="true"/>
                           <separator id="separator1" />
                           <control idMso="IndentIncrease" enabled="true"/>
                           <control idMso="IndentDecrease" enabled="true"/>
                           <separator id="separator2" />
                           <control idMso="AlignLeftToRightMenu" enabled="true"/>
                       </buttonGroup>
                    </box>
                    <box id="BottomBx">
                        <buttonGroup id="buttonGroup_BottomRow">
                           <control idMso="Bold" enabled="true"/>
                           <control idMso="Italic" enabled="true"/>
                           <control idMso="Underline" enabled="true"/>
                           <separator id="separator3" />
                           <control idMso="FontColorPicker" enabled="true"/>
                           <control idMso="TextHighlightColorPicker" enabled="true"/>
                           <control idMso="FontFillBackColorPicker" enabled="true"/>
                           <separator id="separator4" />
                           <control idMso="AlignLeft" enabled="true"/>
                           <control idMso="AlignCenter" enabled="true"/>
                           <control idMso="AlignRight" enabled="true"/>
                           <separator id="separator5" />
                           <control idMso="DatasheetGridlinesMenu" enabled="true"/>
                           <separator id="separator6" />
                           <control idMso="FontAlternateFillBackColorPicker" enabled="true"/>
                        </buttonGroup>
                    </box>
               </group>
           </tab>
       </tabs>
  </ribbon>
  <backstage>
      <tab idMso="TabSave" visible="false" > </tab>
      <button idMso="ApplicationOptionsDialog" visible="false"/>
      <button idMso="FileCloseDatabase" visible="false"/>
  </backstage>
</customUI>
Pepe answered 16/5, 2019 at 2:35 Comment(0)
D
0

Because there remains a backdoor entrance to the access options by using [Quick Access Toolbar] - [Customization], an other simple solution using the same way as Fionnuala could be:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <commands>
         <command idMso="ApplicationOptionsDialog" enabled="false"/>
  </commands>

Denyse answered 4/5, 2019 at 13:49 Comment(0)
F
-1

I have tried this and it seems it works well on your login form or main form that is shown when the database opens, add this procedure:

Private Sub Form_Open(Cancel As Integer)
       ' Go Modal to Lock Navigation Pane
       Me.Form.Modal = True
       ' Hide Navigation Pane
       DoCmd.NavigateTo "acNavigationCategoryObjectType"
       DoCmd.RunCommand acCmdWindowHide
       ' Hide Ribbon
       DoCmd.ShowToolbar "Ribbon", acToolbarNo
       ' Lock Navjgation Pane
       DoCmd.LockNavigationPane (True)
End Sub
Fenelia answered 14/6, 2023 at 11:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.