I know there is a way, but it the right way that I am after!
How can I do a spell check on a form control? Also, are there any options one can due during the spell check, like auto replace, suggest replacement, etc?
Thanks,
Mark
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Spell Check on controls (AXP)
Interactively, press F7 or select Tools | Spellling… while the insertion point is in a control that contains text. You can set various options in the Spelling tab of Tools | Options…
You can invoke the spell checker in code using RunCommand acCmdSpelling. It is wise to add error handling in case spell checking is not possible.
Note: a combo box may display text, but still be bound to a numeric field; it doesn’t count as text then!
You could create a command button cmdSpell with the following On Click code:
Private Sub cmdSpell_Click()
On Errror GoTo ErrHandler
With Screen.PreviousControl
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
RunCommand acCmdSpelling
Exit Sub
ErrHandler:
‘ Just get out
End Sub
By selecting the text within the control, you limit spell checking to that control
The runtime version of Access does not include proofing tools.
If the PC with the runtime version does have Microsoft Word installed, you could use code to load an invisible instance of Word and let it perform the spell check. That obviously won’t work on PCs that don’t have MS Office at all.
I’ve made it work by putting a Spell Check command button on the main form whose code first sets the focus on the continuous subform and then runs the spell check but I can’t figure out how to give the focus back to the main form once the spell check is done so that the upper part of the main form window comes back into view.
You could create a command button cmdSpell with the following On Click code:
Private Sub cmdSpell_Click()
On Errror GoTo ErrHandler
With Screen.PreviousControl
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
RunCommand acCmdSpelling
Exit Sub
ErrHandler:
‘ Just get out
End Sub
By selecting the text within the control, you limit spell checking to that control
Interactively, press F7 or select Tools | Spellling… while the insertion point is in a control that contains text. You can set various options in the Spelling tab of Tools | Options…
You can invoke the spell checker in code using RunCommand acCmdSpelling. It is wise to add error handling in case spell checking is not possible.
Note: a combo box may display text, but still be bound to a numeric field; it doesn’t count as text then!
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications