Modified Spell Check...

I needed a Spell Check to only check the Notes field as opposed to the whole record.  So I adapted some code generously supplied by Arvin Meyer and tinted the Notes field very pale cream and added a line to the below code...
Adjusted to handle Main form / Subform scenario...
The difficult I do immediately, the impossible takes a little bit longer.
Public Function fSpell()
'Arvin Meyer 9/17/1998' Adapted from code by Terry Wickenden
'Amit modified with the help of Marsh [Access VP] for subforms 10.14.2005
'Gina added the ability to check spelling based on .BackColor
Dim ctlSpell, sf_ctlSpell As Control
'Added sf_ctlSpell to refer to subform controls
Dim frm As Form
Set frm = Screen.ActiveForm
DoCmd.SetWarnings False
'Enumerate Controls collection
For Each ctlSpell In frm.Controls
     If TypeOf ctlSpell Is TextBox Then
          If ctlSpell.BackColor = 15400959 Then  'Pale Cream
        If Len(ctlSpell) > 0 Then
             With ctlSpell
             .SetFocus
             .SelStart = 0
             .SelLength = Len(ctlSpell)
             End With
             DoCmd.RunCommand acCmdSpelling
        End If
        End If
     End If
 
If TypeOf ctlSpell Is SubForm Then
For Each sf_ctlSpell In ctlSpell.Form.Controls
     If TypeOf sf_ctlSpell Is TextBox Then
          If sf_ctlSpell.BackColor = 15400959 Then  'Pale Cream
               If Len(sf_ctlSpell) > 0 Then
                    With sf_ctlSpell
                    .SetFocus
                    .SelStart = 0
                    .SelLength = Len(sf_ctlSpell)
                    End With
                    DoCmd.RunCommand acCmdSpelling
               End If
          End If
     End If
Next
End If
Next
DoCmd.SetWarnings True
End Function 
Public Function Spell()
'Arvin Meyer 9/17/1998' Adapted from code by Terry Wickenden
'Gina added the ability to check spelling based on .BackColor
Dim ctlSpell As Control
Dim frm As Form
Set frm = Screen.ActiveForm
DoCmd.SetWarnings False
' Enumerate Controls collection
For Each ctlSpell In frm.Controls
     If TypeOf ctlSpell Is TextBox Then
          If ctlSpell.BackColor = 15400959 Then  'Pale Cream
           If Len(ctlSpell) > 0 Then
                With ctlSpell
               .SetFocus
               .SelStart = 0
               .SelLength = Len(ctlSpell)
               End With
               DoCmd.RunCommand acCmdSpelling
           End If
          End If
     End If
Next
DoCmd.SetWarnings True
End Function 
VBA
Tips (Main)
Home
Creating a Multi-Value field using Alphabet
Copy Fields Down from above Record
Loop thru records and OutPutTo seperate .RTF or .PDF
Code Snippets
Lock\Unlock Bound Controls
Loop while renumbering two columns
Create a Table with Dynamic Field Names
Snippets for Exporting to Excel
Log Field Changes
Log Record Deletions
Check for Duplicate Values
ValidateData()
ClearClipboard()
Selecting an Excel Worksheet from Access
Send eMail to Multiple Recipients
Cancel Save in a Bound Form
Automatically Send eMail Notifications
fFindBookmark()
Looping Records to Send eMail
fxlFindReplace()
This site uses cookies to collect data on usage. By continuing to browse this site you consent to this policy. Find out more here.