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
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