Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why won't 2nd DoCmd.SendObject execute? 1

Status
Not open for further replies.

michellecole

Programmer
Feb 12, 2004
42
US
I am trying to send a particular report in two formats, .snp and .rtf (.rtf for those recipients on older OS of Windows). At this point in the code, I have determined who can get which format. The first report will send, but the second doCmd.SendObject will not execute. (it goes through each line of code in the debugger, but it won't send the email). If I comment out the first doCmd.SendObject code, the second one will execute. I thought maybe it needed some time to finish executing so I placed the sleep command inbetween but the second doCmd still will not execute. Do you see something I am missing? Any Ideas?

Thank you,
Michelle

:
:
If IsEmpty(strTo) Then
'do nothing
Else
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", strTo, "", "", strSubject, strText, False, ""
End If

Sleep (10000) 'sleep 10 seconds to allow execution of first report...

If IsEmpty(strToRichText) Then
'do nothing
Else
DoCmd.SendObject acReport, stDocName, "Rich Text Format(*.rtf)", strToRichText, "", "", strSubject, strTextRT, False, ""
End If
:
:
 
I used the workaround on Microsoft's site for this bug and all is good!! Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top