Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spell Checking Individual Text Boxes within a single record

Status
Not open for further replies.

CharlieT302

Instructor
Mar 17, 2005
406
0
0
US
Hello Everyone,

I have a form with several text boxes within it. Only two of which need to be checked for spelling errors. I am attaching code to a button on the form so that the user can check the spelling when desired.

I have programmatically selected the record prior to running the spell checker so as to only check the current record. This works fin. However, once initiated, the spell checker insists on checking each text box within the record rather than that which I specify.

Basically, I need to check specific text boxes within the current record only. See current code below.

Spell_Comments_Val:
If Trim(Me.Staff_Comments & "") = "" Then
GoTo exit_sub
Else

Spell_Comments:
Me.Staff_Comments.SetFocus
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSpelling

GoTo exit_sub
End If

I am sure that the "SelectRecord" command is negating the .SetFocus command. How else can I accomplish this?


 
Hi All,

Problem Solved. I spotted my error a minute after I sent out my original post. I was isolating the record, when I should have isolated the individual fields. So, naturally it was checking each field within the record.

New Code (isolating fields)
Spell_Comments_Val:
If Trim(Me.Staff_Comments & "") = "" Then
GoTo exit_sub
Else

Spell_Comments:
Me.Staff_Comments.SetFocus
Staff_Comments.SelStart = 0
Staff_Comments.SelLength = Len(Staff_Comments.Text)
DoCmd.RunCommand acCmdSpelling

Hope this helps anyone else needing a similar feature.

GoTo exit_sub
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top