SpellChecking In A Form

  • Thread starter Thread starter Laura
  • Start date Start date
L

Laura

I have this code attached to a command button in an Access form:

Me.fldMemo.SetFocus
DoCmd.RunCommand acCmdSpelling


This is to do a spell check on a memo field in the current record. It
worked fine in Access 97. But now that the database is being run in
Access 2002 (XP), it wants to check every record in the database.

Would anyone know of a fix?

Thanks very much in advance!

Laura
 
I think (but am not sure) that it depends on whether the whole content of
the field is selected, or not. The setfocus might or might not select the
whole field, depending on how certain options are set.

Try doing the spellcheck manually (not through code), once with the whole
field selected, then again with it not. If that is the problem, add one of
the following statements (as appropriate) after the SetFocus call:

me.fldmemo.sellength = 0 ' deselect the field content.
me.fldmemo.sellength = len (me.fldmemo.text) ' select the field content.

HTH,
TC
 
Selection like this seems to work, provided you turn it off after the
spell check by setting the selLength to 0 again. But then try moving
to an adjacent record, and that record is selected; then move back to
the original record, and that record is selected again as well.

What I finally did is use selection during the spell check, but ALSO
include code in the Form_Current module to turn selection off on every
record.

I hate it because I think it's inefficient. Seems there has to be a
better way. But that's what I've come up with so far... Is this a
"feature" or a "bug"?

Thanks,
Laura
 
I would have the spellcheck function select the field, run the spellcheck,
and then deselect the field. No need for form_current to deselect it,
surely?

Why do you say that any of this is "inefficient"?

Cheers,
TC
 
That's precisely what I tried first. But when I did that, then tried
moving to adjacent records, THEY were selected, and so was the
originally spell-checked record when I moved back to it.

Try it out.
 
Yes, that's what I'm saying. It may not work that way if you use the
keyboard to move to adjacent records, but that's what I saw when I
moused back using the record selectors at the bottom of the form.

I don't think it should be that way either. But I don't have a lot of
time to spend trying to figure it out right now. Hence the deselect
code in Form_Current.
 
Back
Top