Spell check on access with out message box

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

On form close i run spell check with the following code
DoCmd.RunCommand acCmdSpelling

If there is not spelling mistakes it brings up message saying 'Spell
check complete' with Ok button

Is there a way to make sure this message box does not apear
 
Hi Simon,

Have you tried using Set Warnings before and after?
Note: Use DoCmd.SetWarnings True in the ExitProc section, so that this is
executed even if an error occurs:

Option Compare Database
Option Explicit

Private Sub Form_Close()
On Error GoTo ProcError

DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSpelling

ExitProc:
DoCmd.SetWarnings True
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Form_Close..."
Resume ExitProc
End Sub


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
The spellchecker is a function of Office, not Access, so you can't trap for
an Office Warning.
 
Back
Top