jtbrown1955
Registered User.
- Local time
- Today, 08:46
- Joined
- May 28, 2005
- Messages
- 17
I have a split database that is shared on the network. Three computers have the front end. The back end is on the network. I obtained a module on this forum to bypass the shift key on start up. This is to protect the database from want-a-be hackers. (we have plenty here) This has worked great for about 6 months. I came back from some days off and the macro will not run on one of the computers. I put the database back together and deleted everything, then imported everything back in from a backup I had. I imported everything; forms, tables, reports, the module and the macro. I split the database and redistrubeted the front ends to the other computers. Same thing, runs on 2, won't on the third. I get the following error; "Compile error: Can't find project or library" in the code, the following line is highlighted in yellow; Function faq_DisableShiftKeyBypass() As Boolean and in the following line Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False) the dbBoolean is highlighted in blue. Here is the code I got off this forum, I wished remembered who to give the credit to, but I don't.
Option Compare Database
Option Explicit
Function faq_DisableShiftKeyBypass() As Boolean
'The next time the database is opened
' after this function has been run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
MsgBox "DisablesShiftKey"
On Error GoTo errDisableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
faq_DisableShiftKeyBypass = True
exitDisableShift:
Exit Function
errDisableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
faq_DisableShiftKeyBypass = False
GoTo exitDisableShift
End If
End Function
Function faq_EnableShiftKeyBypass() As Boolean
MsgBox "EnablesShiftKey"
'The next time the database is opened
' after this function has been run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errEnableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = True
faq_EnableShiftKeyBypass = False
exitEnableShift:
Exit Function
errEnableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, True)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function EnableShiftKeyBypass did not complete successfully."
faq_EnableShiftKeyBypass = False
GoTo exitEnableShift
End If
End Function
Again, this runs on two computers, but not the third. I am running Access 2000.
Option Compare Database
Option Explicit
Function faq_DisableShiftKeyBypass() As Boolean
'The next time the database is opened
' after this function has been run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
MsgBox "DisablesShiftKey"
On Error GoTo errDisableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
faq_DisableShiftKeyBypass = True
exitDisableShift:
Exit Function
errDisableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
faq_DisableShiftKeyBypass = False
GoTo exitDisableShift
End If
End Function
Function faq_EnableShiftKeyBypass() As Boolean
MsgBox "EnablesShiftKey"
'The next time the database is opened
' after this function has been run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errEnableShift
Dim db As DAO.Database
Dim prop As DAO.Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = True
faq_EnableShiftKeyBypass = False
exitEnableShift:
Exit Function
errEnableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, True)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function EnableShiftKeyBypass did not complete successfully."
faq_EnableShiftKeyBypass = False
GoTo exitEnableShift
End If
End Function
Again, this runs on two computers, but not the third. I am running Access 2000.