Data on Emailed Attachments Corrupted Intermittently (1 Viewer)

Sonny Jim

Registered User.
Local time
Yesterday, 19:28
Joined
Jan 24, 2007
Messages
98
I am using Access to email reports as attachments but I am finding that field data is either getting dropped or becoming corrupted intermittently. Referential integrity is enforced between all of the tables. All of the primary keys are indexed while forbidding duplication. I'm not hearing any complaints about corrupted data in any forms, or reports, just in what is emailed "on occasion".

Does this sound familiar to anyone?
 

vbaInet

AWF VIP
Local time
Today, 03:28
Joined
Jan 22, 2010
Messages
26,374
Can you explain what you mean by the data is being corrupted intermittently? How is this evident in the attachment?
 

Sonny Jim

Registered User.
Local time
Yesterday, 19:28
Joined
Jan 24, 2007
Messages
98
Sure. Fields are either blank or have data that is from the wrong records. Sometimes even a last name will show up but the first name is left blank. This is often occurs very unpredictably, and infrequently, perhaps less than ten percent of the time, but often enough to become a problem. In fact, the same report can be Emailed again and look fine. Also, it is not always the same fields that are missing data or have erroneous data. One time two or three fields are missing or erroneous and on another day, with another record, four or five different fields may be missing or erroneous.
 

vbaInet

AWF VIP
Local time
Today, 03:28
Joined
Jan 22, 2010
Messages
26,374
Ok. Can you show me the code you use to e-mail the reports. Please enclose them in code tags too :)
 

Sonny Jim

Registered User.
Local time
Yesterday, 19:28
Joined
Jan 24, 2007
Messages
98
Okay.
Code:
Private Sub cmdEmailCompanyAckRpt_Click()
On Error GoTo Err_cmdEmailCompanyAckRpt_Click

    Dim stDocName As String

    stDocName = "rptCompAckEmail"
    DoCmd.SendObject acReport, stDocName

Exit_cmdEmailCompanyAckRpt_Click:
    Exit Sub

Err_cmdEmailCompanyAckRpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdEmailCompanyAckRpt_Click
    
End Sub
 

vbaInet

AWF VIP
Local time
Today, 03:28
Joined
Jan 22, 2010
Messages
26,374
What's your reason of not being strict on the format that you send the report?

If you write the code fully, i.e. with the output format, to, from, etc... what happens?
 

Sonny Jim

Registered User.
Local time
Yesterday, 19:28
Joined
Jan 24, 2007
Messages
98
My lack of strict formatting is honestly just due to my lack of experience with VBA programming. I will correct this and let you know if it helps. Thanks for the suggestion!
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 03:28
Joined
Jan 22, 2010
Messages
26,374
No problemo! Let us know if you get it working or if you still need help.
 

Users who are viewing this thread

Top Bottom