lloydmav
Registered User.
- Local time
- Today, 18:07
- Joined
- Nov 15, 2002
- Messages
- 75
I have added some code to a transparent button to disable the shift key so that there are no shortcut ways of getting into the design view of my database. I also have a button which enables it again. See code
Private Sub Enable_Click()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
End Sub
Private Sub Disable_Click()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
End Sub
When I run the disable code I get the error "Type mismatch"
Can anyone see what I've done wrong here
Help would be really appreciated
THANKS
Private Sub Enable_Click()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
End Sub
Private Sub Disable_Click()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
End Sub
When I run the disable code I get the error "Type mismatch"
Can anyone see what I've done wrong here
Help would be really appreciated
THANKS