Database Path
I am using the below code to disable the shift key that by passes a macro. How do i determine the path of the databse that I want it to affect?
Sub SetStartupProperties()
ChangeProperty "AllowBypassKey", dbBoolean, False
End Sub
Function ChangeProperty()
Dim strPropName As String
Dim varPropType As Variant
Dim varPropValue As Variant
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
strPropName = "AllowBypassKey"
varPropType = dbBoolean
varPropValue = False
Set dbs = I NEED THE PATH HERE
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
MsgBox "Welcome to First Choice"
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
MsgBox "Please Try Again"
Resume Next
Else
' Unknown error.
MsgBox "ok"
ChangeProperty = False
Resume Change_Bye
End If
End Function
Sam Powell
Information Systems Officer
Neath Port Talbot College
__________________
Sam Powell
Information Systems Officer
Neath Port Talbot College
|