Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NO SHIFT KEY DURING MDE FILE LOADING

Status
Not open for further replies.

ylati

Technical User
Feb 20, 2002
1
IT
MY QUESTION IS:
DURING LOADING AN MDE FILE I WANT TO DISABLE THE SHIFT KEY IN ORDER TO NOT MODIFY THE DATABASE STRUCTURE.
THANKS
MICHELA
 
'This Code Disables the Shift Key

Public Sub DisableByPassKeyProperty()

On Error GoTo ErrorHanderling

Const ErrorNumber = 3367

Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
MsgBox "ByPass Key Disabled"

ExitCode:
Exit Sub

ErrorHanderling:
If Err.Number = ErrorNumber Then
MsgBox "Shift Key Is Disabled"
End If
Resume ExitCode

End Sub

'This Code Re-enables the Shift Key

Public Sub EnableByPassKeyProperty()

On Error GoTo ErrorHanderling

Const ErrorNumber = 3265

Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
MsgBox "ByPass Key Re-Enabled"

ExitCode:
Exit Sub

ErrorHanderling:
If Err.Number = ErrorNumber Then
MsgBox "Shift Key Is Enabled"
End If
Resume ExitCode

End Sub

Try this, it works for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top