disable shift key

D

Desperate!!

I have read a lot of threads here, and have tried a number of different code
samples from various tinternet sites, with varying results. I have
successfully disabled a db, but then the code to re-enable wouldn't work.
I've had various errors, but finally got the following borrowed
(techonthenet.com) code to work by removing two lines (to avoid the error
"Item not found in this collection"). My question is - if it works, do the
blocked out lines matter?

Sub Disable_Click()
Dim db As DAO.Database
Dim prp As DAO.Property

Set db = CurrentDb
' db.Properties.Delete "AllowBypassKey"
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, False, True)
' db.Properties.Append prp

db.Properties.Refresh

Set prp = Nothing
Set db = Nothing
End Sub
 
D

Douglas J. Steele

If the property doesn't actually exist already, then you can get away
without the first blocked out line.

The second blocked out line, however, is required.
 

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