I made a database a while ago that I haven't used in a while. Since then, my computer crashed and I had to get re-imaged. I think that the error is related to the references I have chosen no longer being selected on my re-imaged pc.
The problem is, I am not sure which ones I need to make the code work.
The error I get is "Run time error 3265" Item not found in this collection.
The code I am using is;
to disable
to enable;
When I debug, I get the line db.Properties.Delete "allowbypasskey" highlighted.
The references I have checked are;
Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Access Visual Basic for Applications Extensibility 5.3
Can anyone point me to the reference that I should choose to make the code work?
Thanks in advance.
The problem is, I am not sure which ones I need to make the code work.
The error I get is "Run time error 3265" Item not found in this collection.
The code I am using is;
to disable
Code:
Private Sub DisableShiftKey_Click()
'This code disables shift key'
Dim db As DAO.Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("allowbypasskey", dbBoolean, False)
db.Properties.Append prp
End Sub
to enable;
Code:
Private Sub EnableShiftKey_Click()
'This code re-enables shift key'
Dim db As DAO.Database
Set db = CurrentDb
db.Properties.Delete "allowbypasskey"
db.Properties.Refresh
End Sub
When I debug, I get the line db.Properties.Delete "allowbypasskey" highlighted.
The references I have checked are;
Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Access Visual Basic for Applications Extensibility 5.3
Can anyone point me to the reference that I should choose to make the code work?
Thanks in advance.