65.9K
CodeProject is changing. Read more.
Home

Spell checking in Microsoft Access 2003 applications

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.85/5 (20 votes)

May 30, 2009

CPOL
viewsIcon

31956

downloadIcon

274

An easy way to do spell checking in Microsoft Access 2003 applications.

Introduction

Here is an easy way to do spell checking in an MS Access 2003 application.

Background

For various automation type applications, Microsoft Access is widely used for database and user interface design. In this article, I would like to show you how to do spell checking in Microsoft Access 2003 applications.

Using the code

This is a very simple way. I just use the acCmdSpelling command. The command performs spell checking on the currently focused text control. A code example is given below:

Private Sub btnSpellChecker_Click()
On Error GoTo Err:
    
    With Me.txtMessage
    .SetFocus
        If Len(.Text & vbNullString) > 0 Then
            .SelStart = 0
            .SelLength = Len(.Text)
            DoCmd.RunCommand acCmdSpelling
        End If
    End With
    
Exit Sub

Err:
    'Err.Raise Err.Number, Err.Source, Err.Description
     MsgBox Err.Description
End Sub