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

Status
Not open for further replies.

alec

Programmer
Mar 7, 2001
21
0
0
US
Hello All! I am new to VBA, have only few months of experiance coding with this VB 6.0, need help, thanks!

I have a form created using Access'97. It's working well for years. Now user wanted to have a spell checking button add to the form.
This form is a simple form consisting of several texboxes that pull text data from SQL 7 server.

I've tried to browse the Help section, did not help me at all, went to this forum and search for the words: spell check, got 2 of them but still don't know what to do.

This is what I did so far:
I created a button, named it SpellCheck. On the OnClick event, I wrote this code:

Private Sub SpellCheck_Click()
SendKeys "{F7}", True
End Sub

Of course I still have so many questions, something like:
How would the above code know to check all the texts found on every text on the textboxes once user click on the spell check button???? Any help is very much appreciated - Alec
 
docmd.runcommand accmdspelling is the best way verses send keys
also the spell check works on text field that contain text and it will do the whole form
 
Thank you for your brief respond, since I'm new with VBA I would assume that you wanted me to do the following instead?

Private Sub SpellCheck_Click()
docmd.runcommand accmdspelling
End Sub

I did not work, I got an error saying:
Application-defined or Object-defined error 9536
When I clicked the "OK" button, then I got a message:
"The spelling check is complete"

Why the error message if the spell cheking is working?
Thanks for the input - Alec

 
I tried to temporary ignore the error message and continue on checking if the spell checking code suggeted to me by Braindead2 is working. It is working and I like to thank you for the help despite the error message.

This code is working and checking all the texts inside all texboxes on my form:

Private Sub SpellCheck_Click()
docmd.runcommand accmdspelling
End Sub

My next question is: What does the error message mean????
Application-defined or Object-defined error 9536


 
Sorry I am not sure what the error message is about!
The docmd.runcommand is basically the same thing as going up to the menu and selecting spell check from the menu. I assume you don't get the error when you click spell check, I also assume it does not happen with send keys. I have used the above code several times and never had an error. I suggest you run it with debug and see when the error occurs. If all else fails stick to you sendkeys command.
Good Luck
 
Is the error possibly came from the version?
I use window 2000 as operating system and access 97.
 
Alec,
I could search around and find out exactly what it means but instead I'd like you to try adding this line just above your DoCmd...:
On Error Resume Next

If your spellchecking is working now, fine. If it stops working with this line added, remove this line and we'll have to look further.
If you computer goes in to a stall, hit Ctrl+Break, stop the code from running and remove the line as above...Try it! Gord
ghubbell@total.net
 
Hi Gord, thanks for the suggestion. It've tried it and did not give me any different result.

When there is incorrect word, the spell checking do the job first before error message window pop up. Once the word is corrected and I click OK then the error message show up.
But when there is no word to correct, the error message show up first, then when I hit the OK button, the spell check window show up and said "Spell checking is completed"

And most of the time, when there are more than 4 incorrect word found, as usual the spell checking do the job first before the error message show up then when the spell checking try to correct the last incorrect word, once I hit the "change button", my computer go into a stall. I see the hourglass for hours. I need to hit ctrl+alt+delete to end it.

Isn't what I'm trying to do supposed to be just a simple modification? Alec


 
I'm also trying to use a button for spell check, but I only want it to check a specific field, not to go through all of the records. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top