I was playing with some code online and tried the following in my project to disable default access ribbon
Sub DisableStartupProperties()
ChangeProperty
From the above I understand that you have disabled the shift-key bypass. The best thing to do would be to use the copy you created before running this dangerous code :) If that is not possible, here are some ideas, first, you will need code to change the code in the locked database.
Dim apAccess As New Access.Application
Dim strCodeLine As String
Dim lngLine As Long
''Where "c:\docs\test.mdb" is your database
apAccess.OpenCurrentDatabase "c:\docs\test.mdb"
''Where module2 is the name of your module
With apAccess.VBE.ActiveVBProject.VBComponents("Module2").CodeModule
s = "ChangeProperty ""AllowBypassKey"", dbBoolean, False"
lngLine = 1
''EITHER
''This is useful if the code runs on start-up, if not, see OR
If .Find(s, lngLine, 1, -1, -1) Then
.ReplaceLine lngLine, Replace(s, "False", "True")
End If
''OR
''Assuming that "Call DisableStartupProperties" is in a module, not a form
If .Find("DisableStartupProperties", lngLine, 1, -1, -1) Then
s = "Function RunMe()" & vbCrLf & s & vbCrLf & "End Function"
.InsertLines lngLine - 1, s
End If
End With
If you have chosen OR, you will now have to create a macro called Autoexec:
RunCode : RunMe()
And export that macro to your damaged database. Be very careful, back-up everything first.
Don’t worry, If you have locked your database by using VBA codes. There is a simple way, just copy your database and paste somewhere in not trusted location.
Access will show you a warning don’t click “enable”.
Now you can close form, enable navigation panel and unhide objects.
Once you change the code save file on trusted location.
Hope you can understand me.