Invoking Spellcheck From Within Access for Just One Textbox

E

EarlCPhillips

I help enhance an Access program for the local food bank that tracks
volunteers. We are having trouble getting the spelling of agency names and
addresses correct. I want to invoke Spellcheck from within Access for just
the contents of specific text boxes, probably with a "Before-Update" event.
Invoking Spellcheck from the menu bar tries to check every text box, which I
do not want as only agency names and addresses need to be checked. The rest,
except for names, are combo boxes with tables behind them.

Can anyone help?

EarlCPhillips
Ex-Mainframe Programmer Learning VBA to Help
Feed the Hungry More Efficiently in Kansas City
 
J

John W. Vinson

I help enhance an Access program for the local food bank that tracks
volunteers. We are having trouble getting the spelling of agency names and
addresses correct. I want to invoke Spellcheck from within Access for just
the contents of specific text boxes, probably with a "Before-Update" event.
Invoking Spellcheck from the menu bar tries to check every text box, which I
do not want as only agency names and addresses need to be checked. The rest,
except for names, are combo boxes with tables behind them.

Why use spellcheck, or type in the agency AT ALL!?

If you have a defined list of agencies, create a table named Agencies, with a
unique AgencyID, and the agency name and address (and other information) in
text fields; and put a Combo Box on your data entry form to store the ID. You
can then use queries to look up the name and address, and the combo box will
display the name for you.

Spell check is useless for checking addresses in any case - "3145 Beale St"
and "3514 Beale St" are both correctly spelled, but probably one is wrong.

John W. Vinson [MVP]
 
E

EarlCPhillips

I placed the code your site recommends in-line within the Form_BeforeUpdate
event code, I watched it step through the code, but I cannot see where it did
anything. The text box is named Organization

With Me.Organization
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With

DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling
DoCmd.SetWarnings True

It does not present an error dialog box like Spellcheck does and it does not
correct the incorrectly spelled words. What am I not doing that I should be?

EarlCPhillips
Ex-Mainframe Programmer Learning Access to
Help Food Bank Feed Hungry People Efficiently
 
E

EarlCPhillips

We already have a table of agencies, and as long as this is not a new entry,
the data enterer just selects the correct one. If they are a group that has
never volunteered here before (or in the last three years), they must be
added to the table of agencies, but if they misspell it during data entry,
thereafter it is misspelled. I want to check spelling before the name is
added to the table.

EarlCPhillips
Ex-Mainframe Programmer Learning Access
To Help Feed the Hungry Efficiently
 
D

Douglas J. Steele

Many names will fail spell checking. I question how useful it will be to use
it.

If they do misspell it, and you notice after the fact, all you should need
to is correct the spelling in the Agencies table, assuming your database is
properly normalized.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
J

John W. Vinson

I want to check spelling before the name is
added to the table.

ok... but I've seen some very creative spellings of organization names, and of
course some may be names like "Kirkpatrick Church" or "Owyhee County Services"
which may well not be in your dictionary.

John W. Vinson [MVP]
 
E

EarlCPhillips

I don't mean to be argumentative, but doesn't Spellcheck allow you to add
words to the dictionary? That is what I was counting on for helping with odd
spellings. I am looking to invoke or call that SpellCheck DLL.

Since noone has provided code snipets, no one seems to have felt the need to
do this in their work before. I will continue looking. I think it should be
available in a Windows API.

EarlCPhillips
Ex-Mainframer Programmer Learning Access
Helping Feed the Hungry More Efficiently
 
D

Douglas J. Steele

Alex's code works fine for me, too. When the word was spelled correctly, I
saw nothing. When it was spelled incorrectly, the dialog appeared.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top