I am trying to secure the database with methods more reliable than hiding the navigation panel and hiding the back-end file. Is there a way to completely password-protect all objects from being modified or accessed? Would this cause trouble when they attempt to modify table data through a form? If so, I'm guessing it would be possible to temporarily unlock the tables using VBA.
Ok so I had to do 4 things:
Create a table called USysRibbons. It should have two properties: RibbonName (key) and RibbonXML. Put whatever name you want in RibbonName, but in the RibbonXML, put:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon startFromScratch="true"> <qat> <sharedControls> <control idMso="ImportExcel" label="Import from Excel" enabled="true"/> </sharedControls> </qat> </ribbon> <backstage> <button idMso="ApplicationOptionsDialog" visible="false"/> </backstage> </customUI>
It's important to set
<ribbon startFromScratch="true">
because it prevents users from right-clicking the ribbon or quick access toolbar, selection customise ribbon, and accessing the menu from there. The stuff in the<qat>
tags is just adding an Import from Excel button in the quick access toolbar.Then go to Options > Current Database > Ribbon Name and select the ribbon record you just made. But if they hold the SHIFT key while opening the file, they can see all the objects, options, etc.! To prevent this, we need some VBA to disable and enable that option.
In the VBA editor, put something that accomplishes something similar to this:
Now when that function is run and you select "no", it prevents the SHIFT trick from working. But if you want it to work, log in and click "yes" and close the database and open it with SHIFT.
My wording gets much more elementary as the post dragged on, but hopefully it's still easy to understand.