Henley12
Troy University Fan
- Local time
- Yesterday, 22:16
- Joined
- Oct 10, 2007
- Messages
- 222
I have a form that I am using to send emails to our maintenance department when a work order is written. I want my code to automatically spell check a field on the form before it sends the email. I have the call to the spellcheck function on the buttonclick event, but it does not allow it to complete the spellcheck before it actually sends the email. The code is as follows:
Private Sub cmdSend_Click()
If Not IsNull([Department]) Then
Call cmdSpellCheck (this opens the spellcheck box)
>>>>>>>>>>>>I need it to pause here before completing this code
Me![chkSpellCheck] = -1
Me![EmailSent] = -1
DoCmd.RunCommand acCmdSaveRecord
Call send_email
Dialog.Box "Your email has been sent.", vbOKOnly, "Message Sent"
DoCmd.GoToRecord , , acNewRec
Requestor.SetFocus
Else
Dialog.Box "You must enter a department.", vbOKOnly, "Missing Department"
Department.SetFocus
End If
End Sub
Any ideas? Thanks.
Private Sub cmdSend_Click()
If Not IsNull([Department]) Then
Call cmdSpellCheck (this opens the spellcheck box)
>>>>>>>>>>>>I need it to pause here before completing this code
Me![chkSpellCheck] = -1
Me![EmailSent] = -1
DoCmd.RunCommand acCmdSaveRecord
Call send_email
Dialog.Box "Your email has been sent.", vbOKOnly, "Message Sent"
DoCmd.GoToRecord , , acNewRec
Requestor.SetFocus
Else
Dialog.Box "You must enter a department.", vbOKOnly, "Missing Department"
Department.SetFocus
End If
End Sub
Any ideas? Thanks.