Link to home
Start Free TrialLog in
Avatar of paulmcneil
paulmcneilFlag for United States of America

asked on

Spell check in Access 2010 VBA

I get runtime err 2046, the command or action ‘spelling’ isn’t available now.

when I run the following code in AfterUpdate property of a memo field.

Private Sub DegreeofAttainment_AfterUpdate()
'If the text/memo contains data run the
'Spell Checker after data is entered.
    If Len(Me!DegreeofAttainment & "") > 0 Then
        DoCmd.RunCommand acCmdSpelling
            Else
        Exit Sub
    End If
End Sub
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Make sure you set the Focus on the control, just to be sure:

Me.DegreeofAttainment.SetFocus

Also, SpellCheck must be installed (it's installed with Office, not Access) and you cannot do this in the Runtime environment (i.e. if you're running Access Runtime vs the full retail version of Access).
ASKER CERTIFIED SOLUTION
Avatar of paulmcneil
paulmcneil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paulmcneil

ASKER

Found my own solution