Full Version: spell check
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
brh
I've added spell check to my access toolbar. how do I set it to only review the current form?

Thank you Brian
Larry Larsen
Hii Brian
Here's some code that uses the "Tag" properties of a form control to spell check individual controls as not all controls need checking.

Example :
Tag properties = "Spell Check Me"

Then in a module place this code that's used to check form controls
CODE
Public Sub CheckSpelling(ByRef frmThisForm As Form)
    Dim ctlThisControl As Control
    
    DoCmd.SetWarnings False
    
    For Each ctlThisControl In frmThisForm
        Select Case ctlThisControl.ControlType
        
            Case acTextBox
                If Nz(ctlThisControl, "") <> "" Then
                    If ctlThisControl.Tag = "Spell Check Me" Then
                        With ctlThisControl
                            .SetFocus
                            .SelStart = 0
                            .SelLength = Len(ctlThisControl)
                        End With
                        DoCmd.RunCommand acCmdSpelling
                    End If
                End If
                
        End Select
    Next ctlThisControl
    
    DoCmd.SetWarnings True
    
    MsgBox "The spelling check is complete.", vbInformation
    
End Sub


Then find a form event (button) to call the function to check the current form..

CheckSpelling Me

HTH's

thumbup.gif
brh
thank you Larry, I'll try it out thanks.gif
Larry Larsen
Hi
Your welcome..
thumbup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.