Perhaps someone knows how to structure the correct VBA code to use for
allowing or disallowing use of the bypass key, because the code that I
used as suggested by MSAccess 97 has failed to work. A copy of the
same is pasted below. Any assistance will be appreciated. Thanks,
Dalan
Sub SetStartupPrope rties()
ChangeProperty "StartupShowDBW indow", dbBoolean, True
ChangeProperty "AllowSpecialKe ys", dbBoolean, True
ChangeProperty "AllowBypassKey ", dbBoolean, False
End Sub
Function ChangeProperty( strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFound Error = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties( strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If err = conPropNotFound Error Then ' Property not found.
Set prp = dbs.CreatePrope rty(strPropName , varPropType,
varPropValue)
dbs.Properties. Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
allowing or disallowing use of the bypass key, because the code that I
used as suggested by MSAccess 97 has failed to work. A copy of the
same is pasted below. Any assistance will be appreciated. Thanks,
Dalan
Sub SetStartupPrope rties()
ChangeProperty "StartupShowDBW indow", dbBoolean, True
ChangeProperty "AllowSpecialKe ys", dbBoolean, True
ChangeProperty "AllowBypassKey ", dbBoolean, False
End Sub
Function ChangeProperty( strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFound Error = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties( strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If err = conPropNotFound Error Then ' Property not found.
Set prp = dbs.CreatePrope rty(strPropName , varPropType,
varPropValue)
dbs.Properties. Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
Comment