How to by pass shift key on startup

G

Guest

I set startup property to open my main form and hide database window but
someone can see all objects by press shift key on open file. How can I ignore
this shift key
 
A

Arvin Meyer [MVP]

Try this. It should still work:

Public Function LockDB(blnLock As Boolean)
'====================================================================
' Name: LockDB
' Purpose: Kill the Shift key
'
' Inputs: blnLock As Boolean
'
' Author: Arvin Meyer
' Date: April 19, 1999
' Comment: If blnLock = 0, the bypass key is activated,
' If blnLock = -1, the bypass key is deactivated
' Keep a copy of the database without this property
'=================================================================
On Error GoTo Err_LockDB
Dim prp As Property

Const PropertyNotFound = 3270

CurrentDb.Properties("AllowBypassKey") = blnLock

Exit_LockDB:
Exit Function


Err_LockDB:
'Create the property if not found.
If Err = 3270 Then
Set prp = CurrentDb.CreateProperty("AllowBypassKey", dbBoolean,
blnLock)
CurrentDb.Properties.Append prp
Resume Next
Else
Resume Exit_LockDB
End If

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top