Why email not being sent

SteveL13
SteveL13 used Ask the Experts™
on
I have this code in the afterupdate event of a checkbox.  But when the checkbox is checked true the email is not being sent.  In fact nothing is happening.

Private Sub chkbxSampleShipped_AfterUpdate()

   If Me.chkbxSampleShipped = True Then
   
Dim varName As Variant
Dim varCC As Variant
Dim varSubject As Variant

    varName = "somebody@somewhere.com"
    varCC = "somebodyelse@somewhere.com"

    varSubject = "The sample has been shipped for part # - " & [txtPartN] & ""

    DoCmd.SendObject , , , varName, varCC, , varSubject, varBody, True, False
   
    MsgBox "The samples shipped notification has been emailed to Bill and Bob."

    End If

End Sub

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
see if you have [Event Procedure] in the After Update property of the check box in the EVENT tab of the property sheet,
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
If the msgbox was not just for testing and meant to be part of the program, then I would modify it to:

 MsgBox "The samples shipped notification has been emailed to: " & varName

Jim.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial