Setting up AutoCorrect entries through coding in Access XP

D

Dennis Snelgrove

How do we reference the AutoCorrect object in Access XP? I've got a
front-end that I distribute to a number of PCs, and it would be much nicer
to be able to put code into the initialization routine that adds a number of
AutoCorrect shortcuts we use. Now I've got to go to each PC and manually add
any entries. The only AutoCorrect references I can see find are in Excel.
 
P

Paul Kreingold

We have a similar problem. We have about 50 runtime installations and we
want to turn off the autocorrect using code.
Any ideas?
Paul Kreingold
 
J

John Spencer (MVP)

Yes, instead of doing it at the system level, you can write code that loops
through all the forms and controls and then sets the Allow AutoCorrect to False.

That code could look something like:

Public Sub sSetAutoCorrectFalse()
'REQUIRES DAO Library be set in Tools:References
'Set the allowautocorrect property to false
'on all textbox and combobox controls on all forms
Dim dbAny As DAO.Database
Dim docAny As Document
Dim cntlAny As Control
Dim strFormName As String

Set dbAny = CurrentDb()

For Each docAny In dbAny.Containers("Forms").Documents

strFormName = docAny.Name
DoCmd.OpenForm strFormName, acDesign

For Each cntlAny In Forms(strFormName).Controls
Select Case cntlAny.ControlType
Case acTextBox, acComboBox
If cntlAny.AllowAutoCorrect = True Then
cntlAny.AllowAutoCorrect = False
End If
End Select
Next cntlAny

DoCmd.Close acForm, strFormName, acSavePrompt
Next docAny

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top