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
Clive BeatonAccess DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
   currentdb.Properties("AllowSpecialKeys") = False 'turn off
   currentdb.Properties("AllowSpecialKeys") = True 'turn on

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Clive BeatonAccess DeveloperAuthor Commented:
Thanks, Crystal.  You're  a wiz.

CRB
0
Pallavi GodseSr. Digital Marketing ExecutiveCommented:
What is the version of Microsoft Access you are using?

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

Open in new window

and call -
ChangeProperty "AllowSpecialKeys", dbBoolean, False

Open in new window


To reverse it (turn them back on):
ChangeProperty "AllowSpecialKeys", dbBoolean, True

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.