News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Name:Alex Dybenko

Location:Moscow, Russia

Wednesday, May 10, 2006

More on AutoCorrect option

Another bad thing on AutoCorrect (AutoCorrupt :-) option – is once you created a new database – AutoCorrect is switched on for it. I did not find any global option or registry key to change this. Fortunately – you can control it via code, here a procedure to create database with AutoCorrect switched off, which I got from Allen Browne:

Courtesy of Allen Browne

Sub CreateDatabaseDAO()
Dim dbNew As DAO.Database
Dim prp As DAO.Property
Dim strFile As String

'Create the new database.
strFile = "C:\SampleDAO.mdb"
Set dbNew = DBEngine(0).CreateDatabase(strFile, dbLangGeneral)

'Create example properties in new database.
With dbNew
Set prp = .CreateProperty("Perform Name AutoCorrect", dbLong, 0)
.Properties.Append prp
Set prp = .CreateProperty("Track Name AutoCorrect Info", _
dbLong, 0)
.Properties.Append prp
End With

'Clean up.
Set prp = Nothing
Set dbNew = Nothing
Debug.Print "Created " & strFile
End Sub


Post a Comment

<< Home