Spell Check

G

Guest

When I use spell check in a form for a particular text box, it continues on to the next record. I only want it to check the text box that has focus. Is there a macro or something I can use to have it stay in the text box.
 
J

Jim/Chris

I got this fro a posting by John Spencer

http://groups.google.co.uk/groups?q...s.*&[email protected]&rnum=1

Try the following code. Paste it into a module. It is
designed to check
controls on a single form. I have not checked it on a
continous form, but I
would expect it to work there also.

Public Function fSpell()
'*******************************************
'Name: fSpell (Function)
'Purpose: Spell check current field or fields.
'Author: John Spencer UMBC-CHPDM
'Date: October 31, 2002, 01:15:31 PM
'Control on form must be a textbox and have tag property
'that contains the phrase "SpellCheck"
'*******************************************

Dim ctlSpell As Control
Dim frm As Form

On Error GoTo fSpell_Error

Set frm = Screen.ActiveForm

Set ctlSpell = frm.ActiveControl
With ctlSpell
If TypeOf ctlSpell Is TextBox Then
If InStr(1, Nz(.Tag), "SpellCheck",
vbTextCompare) <> 0 And _
.Locked = False And _
.Enabled = True And _
Len(Trim(ctlSpell.Text & vbNullString)) > 0 Then

.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell.Text)

docmd.RunCommand acCmdSpelling
End If
End If
End With

Exit Function

Jim
-----Original Message-----
When I use spell check in a form for a particular text
box, it continues on to the next record. I only want it to
check the text box that has focus. Is there a macro or
something I can use to have it stay in the text box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

spell checker gone wild! 1
Spell Check 3
Access spell check dialog box 0
Spell check on access with out message box 3
spell check 1
Spell check - round two 2
Spell checking current record 2
Spell Check 11

Top