spell checker (1 Viewer)

stu_c

Registered User.
Local time
Today, 10:55
Joined
Sep 20, 2007
Messages
489
hi all
I have got two text boxes that I want automatically spell checked on update any suggestions?
TXTBOX1
TXTBOX2

I have tried the below code but seems to search all other records rather than just the one I am on?

Code:
Private Sub TXTBOX1_AfterUpdate()
'If the textbox contains data run the
'Spell Checker after data is entered.
    If Len(Me!TXTBOX1 & "") > 0 Then
        DoCmd.RunCommand acCmdSpelling
            Else
        Exit Sub
    End If
End Sub
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:55
Joined
Feb 19, 2013
Messages
16,553
you need to select the text

this works for me


Code:
Private Sub City_AfterUpdate()

    If Nz(City, "") <> "" Then
        With City
             
             .SetFocus
             .selstart = 0
             .SelLength = Len(City)
        
        End With
        
        DoCmd.SetWarnings False
        DoCmd.RunCommand acCmdSpelling
        DoCmd.SetWarnings True

    End If

End Sub
 

stu_c

Registered User.
Local time
Today, 10:55
Joined
Sep 20, 2007
Messages
489
hi mate thanks for the above code, it works great to spell check the text box but when a word in incorrect and pops up with the window with suggestions, once this has been changed and click OK it then goes onto the next text box on the form :/
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:55
Joined
Feb 19, 2013
Messages
16,553
If you want it to stay on the same control to check other words you might need to use the before update event and use the .text property, or perhaps modify the code to include some sort of loop until there are no words left to spell check. Maybe split the text on " " and highlight each word in turn

I don't have time to experiment on your behalf today, have paying clients to keep happy. Spell checker is not something I use - I found the bit of code I provided by simply googling your question. Perhaps google yourself or maybe someone else can step in.

Good luck
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:55
Joined
Jul 9, 2003
Messages
16,245
I have a pop-up spell checker form available on my website here:- Spell Checker Popup Form

There are video instructions demonstrating how it works, and how to add it to your database. The normal price is $2.99, however for a limited time you can download it for free using the coupon code DownloadALL4Fr33
 

missinglinq

AWF VIP
Local time
Today, 06:55
Joined
Jun 20, 2003
Messages
6,423
...once this has been changed and click OK it then goes onto the next text box on the form :/
Just to be clear...is your complaint that Focus moves to the next Textbox on the Form...or that it moves to the next Textbox and tries to SpellCheck that Control as well?

Linq ;0)>
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:55
Joined
May 7, 2009
Messages
19,175
freshly made just for you.
custom-made spell checker.
 

Attachments

  • spelling_udf.zip
    1.4 MB · Views: 186

Users who are viewing this thread

Top Bottom