Link to home
Start Free TrialLog in
Avatar of leezac
leezac

asked on

MS Access Form Spellchecker

I found a piece of code that will spell check a single text box on a form, but how do I  do a spellcheck for all textboxes on a single form.  Is there a way?  Thank you in advance.
Avatar of 2toria
2toria
Flag of United Kingdom of Great Britain and Northern Ireland image

I don't know what your code is but you might use something in your form like:-

Dim c

For each c in forms("yourformnamehere").controls

--->run your code on c.value here

Next

This should loop through your form controls and perform the spellcheck as you want.  You might need to tweak.

HTH,
Matt

Avatar of leezac
leezac

ASKER

thanks Matt I will give a try and let you know.  I will post what I have also
Avatar of leezac

ASKER

Ok -
Here is my code and it works - the only issue is the pop up saying "The spelling check is complete" I have to click on "x" several times before it closes - I think it is looping through.

Private Sub Command2_Click()
  Screen.PreviousControl.SetFocus
  For Each c In Forms("Memo3columnstest").Controls

    DoCmd.RunCommand acCmdSpelling
    Next
End Sub
Get rid of the msgbox popup and put it in the line after the Next statement so that it only shows when the loop has completed.

Matt
ASKER CERTIFIED SOLUTION
Avatar of 2toria
2toria
Flag of United Kingdom of Great Britain and Northern Ireland 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 leezac

ASKER

That worked. Thank you!!!