Create MDE with all menus and shift key access disabled

winshent

Registered User.
Local time
Today, 23:35
Joined
Mar 3, 2008
Messages
162
Does anyone know how I can create an MDE with all options disabled including shift key bypass.

I want to remove all options in Tools>Startup except for the status bar.

I have tried using this code but am not getting anywhere with it

Code:
CurrentDb.Properties("AllowByPassKey") = 0
 
Last edited:
Hi vbaInet

Thanks for your input.

I'm not concerned about automating this at the moment, so can use the menu to set the restrictions for the moment.

I have modified the code as you suggested, but it still does not work.

Code:
CurrentDb.Properties("AllowByPassKey") = False
 
You set the property when the db closes and next time you open it you won't be able to use the shift key.
 
Anyway, if it's an mde file you won't be able to go into the code or make design changes so I'm not even sure the point of this exercise.
 
Where have all your posts gone?

I've only posted one response since my initial thread..

Anyway, if it's an mde file you won't be able to go into the code or make design changes so I'm not even sure the point of this exercise.

The point is I want to create a distributable MDE application where the user cannot open objects using the shift key. I also want to disable everything except the status bar.


You set the property when the db closes and next time you open it you won't be able to use the shift key.

This does not seem to be the case, on my machine at least.
 
I managed to get this working a while ago using using a VBA work around.. Thought I'd post up for anyone else who needs to do the same.

1. Take a copy of the MDB database file.

* Use the copy for locking down as this will not be able to be opened up again once locked down.

* DO NOT LOCK DOWN THE ORIGINAL FILE

2. From the Tools>Startup menu, Deselect all checkbox options other than ‘Display Status Bar’.

3. Check the DAO library is referenced.

4. Run the code below.

5. Create the MDE file.

Code:
Private Sub ap_DisableShift()
    ' This subroutine disable the shift at startup. This action causes
    ' the Autoexec macro and Startup properties to always be executed.
 
    On Error GoTo errDisableShift
 
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Const conPropNotFound = 3270
 
    Set db = CurrentDb()
 
    ' This next line disables the shift key on startup.
    db.Properties("AllowByPassKey") = False
 
    ' The subroutine is successful.
    Exit Sub
 
errDisableShift:
    ' The first part of this error routine creates the "AllowByPassKey
    ' property if it does not exist.
    If Err = conPropNotFound Then
        Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
        db.Properties.Append prop
        Resume Next
    Else
        MsgBox "Subroutine 'ap_DisableShift' did not complete successfully."
        Exit Sub
    End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom