Ok, I see what you mean, so I think it is checking the whole form and Verse happens to be the first control.?
I have only used the spell checker once in my DB,s and did it this way JUST for the relevant control.?
Code:
Call SpellChecker(Me.ActiveControl)
and in a module
Code:
Public Sub SpellChecker(txt As TextBox)
On Error GoTo Err_SpellChecker
If Trim(txt & " ") <> "" Then
'Handles null, emptystring, and space or spaces
'Only way this fails if you have not prinatble characters only ex. VBCRLF
DoCmd.SetWarnings False
txt.SetFocus
txt.SelStart = 1
txt.SelLength = Len(txt.Value)
DoCmd.RunCommand acCmdSpelling
txt.SelLength = 0
'Debug.Print txt.Value
DoCmd.SetWarnings True
End If
Exit_SpellChecker:
DoCmd.SetWarnings True
Exit Sub
Err_SpellChecker:
MsgBox "Error No.: " & Err.Number & vbNewLine & vbNewLine & _
"Description: " & Err.Description & vbNewLine & vbNewLine & _
"Function: SpellChecker" & vbNewLine & _
IIf(Erl, "Line No: " & Erl & vbNewLine, "") & _
"Module: basTest", , "Error: " & Err.Number
Resume Exit_SpellChecker
End Sub
as you just want it on story for now this appears to work.
Code:
Private Sub cmdSpellCheck_Click()
If Len(Me.story) > 0 Then
Me.story.SetFocus
Me.story.SelStart = 1
Me.story.SelLength = Len(Me.story)
DoCmd.RunCommand acCmdSpelling
End If
End Sub
Ok, I see what you mean, so I think it is checking the whole form and Verse happens to be the first control.?
I have only used the spell checker once in my DB,s and did it this way JUST for the relevant control.?
Code:
Call SpellChecker(Me.ActiveControl)
and in a module
Code:
Public Sub SpellChecker(txt As TextBox)
On Error GoTo Err_SpellChecker
If Trim(txt & " ") <> "" Then
'Handles null, emptystring, and space or spaces
'Only way this fails if you have not prinatble characters only ex. VBCRLF
DoCmd.SetWarnings False
txt.SetFocus
txt.SelStart = 1
txt.SelLength = Len(txt.Value)
DoCmd.RunCommand acCmdSpelling
txt.SelLength = 0
'Debug.Print txt.Value
DoCmd.SetWarnings True
End If
Exit_SpellChecker:
DoCmd.SetWarnings True
Exit Sub
Err_SpellChecker:
MsgBox "Error No.: " & Err.Number & vbNewLine & vbNewLine & _
"Description: " & Err.Description & vbNewLine & vbNewLine & _
"Function: SpellChecker" & vbNewLine & _
IIf(Erl, "Line No: " & Erl & vbNewLine, "") & _
"Module: basTest", , "Error: " & Err.Number
Resume Exit_SpellChecker
End Sub
as you just want it on story for now this appears to work.
Code:
Private Sub cmdSpellCheck_Click()
If Len(Me.story) > 0 Then
Me.story.SetFocus
Me.story.SelStart = 1
Me.story.SelLength = Len(Me.story)
DoCmd.RunCommand acCmdSpelling
End If
End Sub
and go the module route if you wish to do more.
Thanks. I will incorporate your code.
two additional comments. 1. If you only used a spell checker once, it must mean you are a better speller than me.
Second was your salutation. I was discussing “free loaders” at my local restaurant with a very political liberal person. He said you are a preacher how can you have that attitude, what does the Bible say about feeding the poor. I said if you don’t work you don’t eat. He said what about the verse that says give a man a fish and he eats for one day, teach him to fish and he eats every day. The rest of us almost fell of our chairs laughing. It’s a virtuous thought but it’s not a Bible verse. Secondly, he somehow missed his own point. If I teach him to fish, that means he has too work, to fish.
What I meant was that I have only implemented the spelling functionality in one of my DBs and that was only after helping someone with his version. Then I thought 'Why not add one to my charity DB for my notes field?' and so I did. That is where I got the process I highlighted above.
Strangely enough, I could not find much info on exactly how to use it via MS.
What I meant was that I have only implemented the spelling functionality in one of my DBs and that was only after helping someone with his version. Then I thought 'Why not add one to my charity DB for my notes field?' and so I did. That is where I got the process I highlighted above.
Strangely enough, I could not find much info on exactly how to use it via MS.
Well I thank you anyways. Better speller than me is an understatement. My sister was swapping email with me one night and asked why my spelling was so bad. I told her my spell checked already went to bed.
Well thinking about it, I have always been decent at spelling. Used to get gold stars in Primary school.
Plus spelling mistakes tend to jump out at me.
Just as well these days, as my typing is getting atrocious.
Well thinking about it, I have always been decent at spelling. Used to get gold stars in Primary school.
Plus spelling mistakes tend to jump out at me.
Just as well these days, as my typing is getting atrocious.
I have put a spell check in a DB I have just created. It works but It tries and correct to field.
The two fields it corrects are “verse” short text, and “story” long text. I want it to correct “story” long text, only.