Clive Beaton
asked on
How to set database System Options
Can I turn off System Option 'Use Access Special Keys' in VBA?
If so, I would appreciate a line of code.
Thanks in advance,
CRB
If so, I would appreciate a line of code.
Thanks in advance,
CRB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the version of Microsoft Access you are using?
If you are using 2003 version then try the code below -
To reverse it (turn them back on):
If you are using 2003 version then try the code below -
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270
10 Set dbs = CurrentDb
20 On Error GoTo Change_Err
30 dbs.Properties(strPropName) = varPropValue
40 ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else ' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
and call - ChangeProperty "AllowSpecialKeys", dbBoolean, False
To reverse it (turn them back on):
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ASKER
CRB