Access looping through a recordset to send emails and then randomly repeating

I have multi functional Access DB that generates a series of spreadsheet, one per cutomer. I have then built a module that selects these spreadsheets one by one and emails them to a selected email address stored in the DB. Currently it generates 413 spreadsheets and then when I go to email them something weird happens. The code cycles once, sending 413 emails, and then randomly it sometimes cycles a second time and send all 413 again. It appears to be that if I open the db from scratch it sends 413, but if the db is open and emails have previously been sent without closing it send 826. I presume a variable is being held somewhere, but I cannot see where or why.

The code is below, rs3 selects the path for the outlook templates and where the spreadsheets are stored. Then rs1 selects the 413 record (filename, email addresses, etc.), this rs is looped. rs2 selects the total value per invoice, invoice number and currency per row. There are a couple of loops prior to mail send that replaces tags in the mail template with these values. Does anyone have any idea whe i’m missing?

Sub send_spreadsheet()


Dim rs1, rs2, rs3 As Recordset
Dim mailto, mailfrom, mailcc, subject, template, filename, poct As String
Dim OutApp As Outlook.Application
Dim FileInFromFolder As Object
Dim Mail_Object, Mail_Single As Variant
Dim sSource As String
Dim I As Long
Dim OutMail As Outlook.MailItem
Dim olinsp As Object
Dim oRng As Object
Dim wdDoc As Object
Dim valu, po As Long


Set rs3 = CurrentDb.OpenRecordset("SELECT defaults.excel_results, defaults.[email _templates] FROM defaults;")
Let tmplpath = rs3![email _templates]
Let filepath = rs3!excel_results

Set rs1 = CurrentDb.OpenRecordset("SELECT tmp_data_for_report.Template, tmp_data_for_report.filename, tmp_data_for_report.[mail subject], tmp_data_for_report.PO_Contact, " & _
"tmp_data_for_report.[Customer_POC-email], tmp_data_for_report.AM_EMAIL FROM tmp_data_for_report GROUP BY tmp_data_for_report.Template, tmp_data_for_report.filename, " & _
"tmp_data_for_report.[mail subject], tmp_data_for_report.PO_Contact, tmp_data_for_report.[Customer_POC-email], tmp_data_for_report.AM_EMAIL;")

If rs1.RecordCount > 0 Then
MsgBox rs1.RecordCount


 rs1.MoveFirst
 Do While Not rs1.EOF
 Let filename = rs1!filename
Let template = tmplpath & rs1!template & "_PO.oft"
Let subject = rs1![Mail Subject]
Let mailto = rs1!.PO_Contact
Let mailcc = rs1![Customer_POC-email] & ";" & rs1!AM_EMAIL

Set rs2 = CurrentDb.OpenRecordset("SELECT tmp_data_for_report.filename, tmp_data_for_report.PONUMBER, tmp_data_for_report.CURRENCYCODE, Sum(tmp_data_for_report.TOTAL) AS " & _
"SumOfTOTAL FROM tmp_data_for_report GROUP BY tmp_data_for_report.filename, tmp_data_for_report.PONUMBER, tmp_data_for_report.CURRENCYCODE " & _
"HAVING (((tmp_data_for_report.filename)='" & filename & "'));")
 Let valu = rs2!SumOfTOTAL
 Let curr = rs2!CURRENCYCODE
 Let po = rs2.RecordCount
Let filename = filepath & filename

    Set OutApp = CreateObject("Outlook.Application")
 Set OutMail = OutApp.CreateItemFromTemplate(template)
 OutMail.Display
'
' CYCLE THROUGH AVAILABLE MAIL ACCOUNTS (PERSONAL AND PROCESS TO IDENTIFY CORRECT SEQUENCE NUMBER
'
    For I = 1 To OutApp.Session.Accounts.Count
    If OutApp.Session.Accounts.Item(I) = "[email protected]" Then Let ACCNO = I
    Next I
'
'SEND EMAIL BASED UPON sp data
Set Mail_Object = CreateObject("Outlook.Application")
'Set OutMail = OutApp.CreateItem(olMailItem)
If ACCNO = "" Then Let ACCNO = 1
With OutMail
.SendUsingAccount = OutApp.Session.Accounts.Item(ACCNO)
.subject = subject
.To = mailto
.CC = mailcc
.BCC = ""
'.Body = mb
.Display
.Attachments.Add filename

Set olinsp = .GetInspector
Set wdDoc = olinsp.WordEditor
Set oRng = wdDoc.Range
With oRng.Find
Do While .Execute(FindText:="XVALX")
oRng.Text = valu
Exit Do
Loop
End With
Set oRng = Nothing
Set oRng = wdDoc.Range

With oRng.Find
Do While .Execute(FindText:="XCURRX")
oRng.Text = curr
Exit Do
Loop
End With
Set oRng = Nothing
Set oRng = wdDoc.Range
If po = 1 Then Let poct = "1 PO was "
If po > 1 Then Let poct = po & " POs were"

With oRng.Find
Do While .Execute(FindText:="XPOX")
oRng.Text = poct
Exit Do
Loop
End With

.Send
End With

    Set OutMail = Nothing
    Set OutApp = Nothing
   rs1.MoveNext
Loop

End If
Set rs1 = Nothing
Set rs2 = Nothing
End Sub

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật