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
Tips (Main) |
Home |