Email Reports - Memory leak? 
Author Message
 Email Reports - Memory leak?

I'm trying to Email a report to each Client and the report to only have the
relevant information in it relevant to the client.  I had this working fine
with the following code.  However,  now it gets to about 4 or 5 reports and
then I get an out of memory message.  The reports are only about 5kb each.

Previously I'd tested it on dummy data and got up to 60+ Emails with
attachments all sitting nicely in my Outbox.

Any ideas?

Private Sub cmdEmailExportReport_Click()
Dim db As Database
Dim rst As Recordset
Dim strEmail As String
Dim strSubject As String
Dim strMessage As String

Set db = CurrentDb
Set rst = db.OpenRecordset("tblMyTableName") 'Table holding email address
Info
strSubject = Me![Subject] 'txtbox on Form to hold Subject
strMessage = Me![Message] 'txtbox on Form to hold Message
rst.MoveFirst
Do Until rst.EOF
strEmail = rst!Email 'Name of Field holding Email Address
Me!txtDisplayID = rst!CompanyIDName  'Name of field on form to hold ID or
Name
DoCmd.SendObject acSendReport, "rptMyReportName", acFormatRTF, strEmail, ,
,strSubject,strMessage,False
rst.MoveNext
Loop
End Sub



Sun, 05 Dec 2004 19:46:32 GMT  
 Email Reports - Memory leak?
Sorry, SendObject is only there to confuse you:

ACC2000: SendObject Method Fails in Access 2000 (Q260819)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q260819&id=26...

(david)

Quote:

> I'm trying to Email a report to each Client and the report to only have the
> relevant information in it relevant to the client.  I had this working fine
> with the following code.  However,  now it gets to about 4 or 5 reports and
> then I get an out of memory message.  The reports are only about 5kb each.

> Previously I'd tested it on dummy data and got up to 60+ Emails with
> attachments all sitting nicely in my Outbox.

> Any ideas?

> Private Sub cmdEmailExportReport_Click()
> Dim db As Database
> Dim rst As Recordset
> Dim strEmail As String
> Dim strSubject As String
> Dim strMessage As String

> Set db = CurrentDb
> Set rst = db.OpenRecordset("tblMyTableName") 'Table holding email address
> Info
> strSubject = Me![Subject] 'txtbox on Form to hold Subject
> strMessage = Me![Message] 'txtbox on Form to hold Message
> rst.MoveFirst
> Do Until rst.EOF
> strEmail = rst!Email 'Name of Field holding Email Address
> Me!txtDisplayID = rst!CompanyIDName  'Name of field on form to hold ID or
> Name
> DoCmd.SendObject acSendReport, "rptMyReportName", acFormatRTF, strEmail, ,
> ,strSubject,strMessage,False
> rst.MoveNext
> Loop
> End Sub



Tue, 07 Dec 2004 10:08:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Memory Leaks/Resource Leaks

2. No error reported and memory leak if error occurs in Class_Terminate

3. Memory Leak Report

4. OLE Automation Problems - MEMORY HOG (Memory Leak?)

5. memory leak in vitual memory

6. memory leak on vitual memory

7. Memory Leak -- Out of Memory

8. ADO Memory Leak results in out of memory

9. Memory leaks using shell from VBA with winAPI kernel32

10. Try this in XP ? (memory leak)

11. Horrible Memory Leaks...

12. large number of execute statements / memory leak ?

 

 
Powered by phpBB® Forum Software