Message to display IF spelling errors (1 Viewer)

Kayleigh

Member
Local time
Today, 23:39
Joined
Sep 24, 2020
Messages
706
Hi,
I have the following code on the exit event of several textboxes. I would like to add an input message to ask the user if they wish to go ahead with the spellcheck but only if there it detects spelling errors (ie it shouldn't display when no errors). Any ideas how I could go about this?
One suggestion I was considering was performing a count on the number of errors found and then displaying message if >0 however the only code I found to do this was for a Word doc and I'm not certain that these commands would work in Access...

Code:
This is my code:
With Me.fldOJobDescription
  If Len(.Value) > 0 Then
    DoCmd.SetWarnings False
    .SelStart = 1
    .SelLength = Len(.Value)
    DoCmd.RunCommand acCmdSpelling
     .SelLength = 0
    DoCmd.SetWarnings True
  End If
End With
 
Last edited by a moderator:

Minty

AWF VIP
Local time
Today, 23:39
Joined
Jul 26, 2013
Messages
10,366
I think you are in a catch 22 situation there, it can only check if the spelling needs correcting by actually checking the spelling in the first place.
In Access I don't think you can call the spell checker "in the background", although I'm happy to be proved wrong!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 23:39
Joined
Jul 9, 2003
Messages
16,271
Any ideas how I could go about this?
I have a pop-up form that operates as a spell checker. See:-


If that's an option that might be suitable, then click the download button for the code. Use the Coupon Code:- 4qmas07 to obtain a free Copy...

All I ask is that you sign up to my Newsletter here:-

• Get Nifty Access News!
 

Kayleigh

Member
Local time
Today, 23:39
Joined
Sep 24, 2020
Messages
706
Thanks would be interested in taking a look. I've signed up to your newsletter but when I try downloading your product it only asks for bank details and no option to input your free code?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 23:39
Joined
Jul 9, 2003
Messages
16,271
no option to input your free code?

Sorry about that! I forgot to switch on the "discount code field" to the purchase form. Please try it again it should work now...
 

Isaac

Lifelong Learner
Local time
Today, 15:39
Joined
Mar 14, 2017
Messages
8,774
The last time I wanted to provide a spell check in Access, I reviewed the available Access-based options and (for some reason I cannot remember right now), decided to do this instead, in code: Fire up an Excel instance in the background, place the value from the Access control into the Excel cell, run Excel's Range.CheckSpelling (which will result in the spelling/correction/replace/ignore options being displayed to the end user), and when the Spell Check dialogue was finished, place the checked results from that same Excel cell, back into the Access control.

Again, I can't remember why I decided to do it that way at the moment, but regardless, I was satisfied with the end result.
 

Kayleigh

Member
Local time
Today, 23:39
Joined
Sep 24, 2020
Messages
706
Would anyone know if there is a way to detect if user selected 'Ignore all' to spelling errors. As I would like to add a variable to save this setting for future. Is this possible?
 

Isaac

Lifelong Learner
Local time
Today, 15:39
Joined
Mar 14, 2017
Messages
8,774
If you find code that checks if a specific word is in the Dictionary (which I'm 99% sure there IS such code, you'd have to search around a bit maybe), then you could loop through the space-delimited chunks of text AFTER the spellcheck, to see whether any words are still left there which aren't in the dictionary. If so, then maybe you could assume the user ignored that word and take whatever kind of action you want to take.

But is this reinventing the wheel to some extent? Why not just train them to Add to Dictionary ?
 

Kayleigh

Member
Local time
Today, 23:39
Joined
Sep 24, 2020
Messages
706
You are right. I was just wondering if there was some way to bypass the dictionary.
 

Users who are viewing this thread

Top Bottom