The code was working great and then stop working when I clicked the send email button.
Private Sub cmdMailTicket_Click()
Dim stWhere As String '-- Criteria for DLookup
Dim <g class="gr_ gr_101 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="101" id="101">varX</g> As Variant
'-- Address for SendObject
Dim stRequestor As String '-- Criteria for DLookup
Dim CcTO As Variant '-- Address from Requestor
Dim <g class="gr_ gr_103 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="103" id="103">stText</g> As String
'-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim <g class="gr_ gr_104 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="104" id="104">stSubject</g> As String
'-- <g class="gr_ gr_106 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="106" id="106">Subject</g> line of <g class="gr_ gr_107
gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="107" id="107">e-mail</g>
Dim stTicket_ID As Variant '-- The PMT ticket ID
Dim stILMSTICKET_REPORTNUMBER As String '-- The ILMS ticket number from <g class="gr_ gr_108 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="108" id="108">form</g>
Dim stCustodialOfficer As String '-- The Appointed Custiodal Officer
Dim <g class="gr_ gr_105 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="105" id="105">stDescription</g> As String
'-- Description of request
Dim stWho As String '-- Reference to Property Mangement Team Members
Dim stHelpDesk As String '-- Person who assigned <g class="gr_ gr_109 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="109"
id="109">ticket</g>
Dim strSQL As String '-- Create SQL update statement
Dim errLoop As Error
'-- Combo of names to assign ticket to
stWho = Me.Assigned_To.Column(1)
stWhere = "[Property Management Team Members.TeamMembers] = " & "'" & stWho & "'"
'-- Looks up email address
varTO = DLookup("[EmailAddress]", "Property Management Team Members", stWhere)
stRequest = Me.CUSTODIAL_OFFICER
stRequestor = "CustodialOfficers.CustodialOfficers = " & "'" & stRequest & "'"
'-- Look up email address from Requestor
CcTO = DLookup("[EmailAddress]", "CustodialOfficers", stRequestor)
stSubject = "Property Management Request Acknowledgement"
stTicket_ID = Format(Me.PMTicketID, "000000")
stILMSTICKET_REPORTNUMBER = Format(Me.Ticket_____Report_Number, "00000")
RecDate = Me.DATE_RECEIVED
'-- Property Team employee who assigns ticket
strHelpDesk = Me.Assigned_By.Column(1)
'-- The Appointed Custiodal Officer
stCustodialOfficer = Me.CUSTODIALOFFICER
'-- Description of request
stDescripton = Me.ACTION_DESCRIPTION
stText = "Your Property Management Request has been assigned for further review, and the Property Management Specialist will communicate with you shortly." & Chr$(13) & _
Chr$(13) & "Property Management Ticket ID Number: PMTicketID-" & stTicket_ID & Chr$(13) & _
"The ticket has been assigned to: " & stWho & Chr$(13) & _
"Assigned by: " & strHelpDesk & _
Chr$(13) & "Ticket Received On: " & RecDate & Chr$(13) & _
Chr$(13) & "Your Cusditoal Officer for this matter is: " & stCustodialOfficer & Chr$(13) & _
"The ILMS Ticket or Report Number is: " & stILMSTICKET_REPORTNUMBER & Chr$(13) & _
Chr$(13) & "Breif description of request: " & stDescripton & Chr$(13) & _
Chr$(13) & "Please contact us if you have any further questions at DSMGTLSProperty@state.gov." & Chr$(13) & _
Chr$(13) & "******THIS IS AN AUTOMATED MESSAGE, PLEASE DO NOT RESPOND TO THIS EMAIL.******"
'Write the e-mail content for sending to assignee
DoCmd.SendObject acSendNoObject, , acFormatTXT, varTO, CcTO, "DSMGTLSProperty@state.gov", stSubject, stText, -1