Link to home
Start Free TrialLog in
Avatar of Megin
Megin

asked on

Access spellchecker - If no errors, no acknowledgement

I am using this piece of code in order to spell check an entry in an access form.

If Len(vardesc) > 0 Then
    DoCmd.RunCommand acCmdSpelling
    Else
    End If

Open in new window


It works perfectly.

However, every time it doesn't detect a spelling error, it acknowledges that the spell check is complete, making the user add another click to the process.

Is it possible to tell it to skip the acknowledgement? If there are no spelling errors, have it just move to the next step without telling the user that the spellcheck is complete?
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Megin
Megin

ASKER

Okay. Good advice.

Thank you!

(I don't know anything about the SendKeys thing, so no worries there)
SendKeys would let you use VBA to emulate a user at the keyboard, typing.
If everything went well, your keystrokes went where you wanted them to.
If other windows popped open, or up, then the keystrokes would go there.

from the Access 2003 help

SendKeys Statement Example
This example uses the Shell function to run the Calculator application included with Microsoft Windows. It uses the SendKeys statement to send keystrokes to add some numbers, and then quit the Calculator. (To see the example, paste it into a procedure, then run the procedure. Because AppActivate changes the focus to the Calculator application, you can't single step through the code.). On the Macintosh, use a Macintosh application that accepts keyboard input instead of the Windows Calculator.
Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1)    ' Run Calculator.
AppActivate ReturnValue     ' Activate the Calculator.
For I = 1 To 100    ' Set up counting loop.
    SendKeys I & "{+}", True    ' Send keystrokes to Calculator
Next I    ' to add each value of I.
SendKeys "=", True    ' Get grand total.
SendKeys "%{F4}", True    ' Send ALT+F4 to close Calculator.

Open in new window


With luck, you could use SendKeys on Access objects and modal dialog boxes to automate functions that were inaccessible from VBA -- but it was always a stick that was prone to breaking, so it shouldn't be leaned on.
And In Windows 7 it causes the NumLock toggle issue