I got this off the web and I am trying to set this up for my own uses. I get Error "91 Object variable or With Block variable not set."
I am wanting the option to edit email before sending and using outlook to put in email addresses. I will set up the formatting with the VBCRLF/ CHR(10)/(9) and so forth afterwards
Database Name: NIE 15_2 CRs
Table Name: Change Request
Query: GO_Email
Fields (partial list): CR_Numbers, Date Issue Identified, Change Request......
Dim db As Database
Dim rstNIE_15_2_CRst As Recordset
Dim strSQL As String
Dim strSubject, strBody As String
Set NIE_15_2_CRs = CurrentDb()
strSQL = "SELECT * FROM GO_EMail"
Set rstNIE_15_2_CRs = db.OpenRecordset(strSQL, dbOpenDynaset)
If Not rstGO_Email.EOF Then
strBody = "This Change Request" & vbCrLf & vbCrLf
strBody = strBody & "Date CR Number Change Requested" & vbCrLf
strBody = strBody & "==================================" & vbCrLf
rstGO_Email.MoveFirst
Do While Not rstGO_Email.EOF
strBody = strBody & rstGO_Email("CR_Numbers") & Chr(9) & _
rstGO_Email("Date Issue Identified") & Chr(9) & _
rstGO_Email("CR_Numbers") & Chr(9) & _
rstGO_Email("[Change Requested]") & vbCrLf
rstGO_Email.MoveNext
Loop
End If
strSubject = "ALLCON,Here's my report!"
DoCmd.SendObject acSendNoObject, , acFormatTXT, , , strSubject, strBody, True
Exit Sub
Thanks