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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is the Email invoice report is blank but Print Preview is just fine. 1

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
US
I have had success making email buttons. But not this one. I have 2 buttons on the Invoice form. One to print preview or go to the printer. The newer one is for an email.

The email address gets into the MS Outlook "TO" just fine. The PDF gets into the attachment just fine.

However, the PDF content has only the report formatting etc except there is NO DATA in the report. See the email button ON Click below:

(PS - where you see "Name" txtOrderID, I original used the Control Source OrderID. But i got the same problem either way. The report button did not seem to care either if i used txtOrderID or OrderID. i wonder which is best: the name or the control name?)

In the query Qry8700Invoice for the rpt8700Quote, I have a criteria in the OrderID field of: [Forms]![frm8700OrdersMain]![txtOrderID]

Just in case you needed to know. Again, the report button works fine. It gets previews the proper invoice. But the Mail Button will only show an invoice format with no data.
I don't get it.

Thanks, Cimoli and Glen


'------ here is the email button ON CLICK ------------
Private Sub cmdPrintEmail_Click()

On Error GoTo Err_cmdPrintEmail_Click

Dim strDocName As String
Dim strWhere As String

strWhere = "OrderID = " & Me.txtOrderID
strDocName = "rpt8700Quote"

DoCmd.SendObject acReport, strDocName, acFormatPDF, Me!cboEmail22

Exit_cmdPrintEmail_Click:
Exit Sub

Err_cmdPrintEmail_Click:
' If action was cancelled by the user, don't display an error message.
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_cmdPrintEmail_Click
Else
MsgBox Err.Description
Resume Exit_cmdPrintEmail_Click
End If

End Sub
 
Hi Duane. I am not sure how to handle what you said. If possible, could you or someone take a peek at an attached mini TEST file (just 1.6 mb)that i made?

My method so far is to fill out the order. Then i click on the RED email pick and get an email address. Then i hit the email button at the top black right area. Next to the Print button.

The Print button works fine. I get the proper invoice to view and print.

But the email button only gives me an invoice style but with ZERO data.

I almost had it. thank you in advance. Cimoli glen
 
 http://www.mediafire.com/?6y0ur4q6uslapor
My goal after the one above is to learn how to pick Multiple emails for the given one Order. Just a thought.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top