Solved How to disable the Privacy Option in Microsoft Access (1 Viewer)

nector

Member
Local time
Today, 14:00
Joined
Jan 21, 2020
Messages
368
Well I have noticed that even if I disable the other function using code and compile the database into accde the privacy option still remain which allow to still unlock the others. How do I get lid of it?

I use the code below turn off and on special keys but the privacy option still remains visible, what should I do.


Code:
Sub DisableStartupProperties()
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
End Sub
Function ChangeProperty(strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume Change_Bye
End If
End Function
Sub EnableStartupProperties()
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:00
Joined
Oct 29, 2018
Messages
21,473
You can use a custom ribbon to get rid of it.
 

isladogs

MVP / VIP
Local time
Today, 12:00
Joined
Jan 14, 2017
Messages
18,225
Add this line to a custom ribbon
Code:
  <button idMso="ApplicationOptionsDialog" visible="false"/>

For more info, see my article:

If you want, you can remove all items from the File menu AKA Backstage view
You can also remove the ribbon completely
 
Last edited:

nector

Member
Local time
Today, 14:00
Joined
Jan 21, 2020
Messages
368
Thank you so much all for the suggestion though the correct procedure was not given. For the sake of new beginners , here is the procedure below:
(1) Create a system table , example , UysRibbon
(2) Ribbon ID Field
(3) XML Field

Then in XML field paste the XML code below:

Code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"><ribbon startFromScratch="false"></ribbon><backstage><button idMso="ApplicationOptionsDialog" visible="false"/></backstage></customUI>

Or just use an autoex macro to call the code below , but you have to put the code in a module and simply call it.

Code:
Function LoadNectorRibbon()
Dim sXML
  sXML = "<customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"">" & _
      "<ribbon startFromScratch=""false"">" & _
      "</ribbon>" & _
      "<backstage>" & _
      "<button idMso=""ApplicationOptionsDialog"" visible=""false""/>" & _
      "</backstage>" & _
      "</customUI>"
  Application.LoadCustomUI "SimpleFile2", sXML
End Function
 

isladogs

MVP / VIP
Local time
Today, 12:00
Joined
Jan 14, 2017
Messages
18,225
Thank you so much all for the suggestion though the correct procedure was not given.
Hi @nector
The full procedure was given as part of the article I linked in post #3.
I just gave you the relevant line in my post
 

Users who are viewing this thread

Top Bottom