Spell Check Help

  • Thread starter Thread starter bladelock
  • Start date Start date
B

bladelock

Good Day,
I have this code in my text box that accepts text (memo):

If Len(Me!CASEFACTS & "") > 0 Then
DoCmd.RunCommand acCmdSpelling
Else
Exit Sub
End If

The only problem I'm having with spell check is that it checks the whole
form. I just want to spell check only the textbox that the code is in. Is
this possible?
 
bladelock,

That is an issue, so I use the one below. I added the line * If
ctlSpell.BackColor = 15400959 Then* so that any box on a form I want spell
checked I tint that color and it only checks that one. Using a button, you
can activate with

Private Sub cmdSpellCheck_Click()
Call Spell
End Sub


'***Start of Code
Public Function Spell()
' Arvin Meyer 9/17/1998
' Adapted from code by Terry Wickenden
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
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
'**End of Code

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
Back
Top