Option Compare Database
Option Explicit
Public Function SpellChecker(txt As TextBox) As Boolean
On Error GoTo Err_SpellChecker
With txt
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
SpellChecker = Len(.Text) > 0
End With
With DoCmd
.SetWarnings False
.RunCommand acCmdSpelling
End With
Exit_SpellChecker:
DoCmd.SetWarnings True
Exit Function
Err_SpellChecker:
Select Case Err.Number
Case 2046
' not available
Case Else
MsgBox "Error No.: " & Err.Number & vbNewLine & vbNewLine & _
"Description: " & Err.Description & vbNewLine & vbNewLine & _
"Function: SpellChecker" & vbNewLine & _
IIf(Erl, "Line No: " & Erl & vbNewLine, "") & _
"Module: basTest", , "Error: " & Err.Number
End Select
Resume Exit_SpellChecker
End Function