Disable Shift Key (again) (1 Viewer)

psyc0tic1

Access Moron
Local time
Today, 00:52
Joined
Jul 10, 2017
Messages
360
It turns out I had a couple of users that I can only assume they know how to bypass the code in my database because they were still using older versions than current (v015) but new enough that the auto updater code was in place and should have forced a version update like has worked for everyone else. The version they were using was v011 and the auto updater code was added in v009.

I wanted to disable the shift key and came across a post somewhere that said to make a form with 2 command buttons. One for disabling the shift key and one for enabling the shift key. I liked this because I didn't want to keep a copy for me and a distribution copy.

The instructions said to use this code for the command buttons.
Code:
Option Compare Database
Option Explicit

Private Sub cmdHideDatabase_Click()
    CurrentDb.Properties("AllowBypassKey") = False
End Sub

Private Sub cmdShowDatabase_Click()
    CurrentDb.Properties("AllowBypassKey") = True
End Sub
This gave me the Run-time error 3270 Property not found and highlighted the CurrentDb. Properties etc.

I tried adding the Microsoft DAO 3.6 reference and I received an error stating Error loading DLL and it turns out that the reference box is looking in the location
Code:
C:\Program Files\Common Files\Microsoft Shared\DAO
but on my computer there is no DAO folder in there. I found the folder and dll in the Program Files (x86) etc. so I added the folder to the afore mentioned path and put in the dll file and then I get the error that this reference Name conflicts with an existing module, project, or object library.

I also read somewhere that this is included with the Microsoft Office 14.0 Access database engine Object Library but I do not use 14.0... I use 15.0 and it is already selected for other reasons in the database.

Can anyone help me with making this work.

I have read several other methods but I was hoping to use this simple version.
 

isladogs

MVP / VIP
Local time
Today, 06:52
Joined
Jan 14, 2017
Messages
18,212
Arnel has given you a link that should give you the code you need

For info, Microsoft Office xx.0 Access database engine Object Library is a replacement for the old Microsoft DAO 3.6 reference with additional functionality.
You don't need and indeed can't have both of them.

Both Microsoft Office 14.0 & 15.0 library references are equivalent for this purpose
 
Last edited:

Users who are viewing this thread

Top Bottom