Forms & Subforms and email

L

Liam Kitson

I have a main form which contains one subforms. All of the data is from
the same record. The main form contains the personals details and the
subform contains their order details. I would like to use a button which
would send that records (main form and subform details) in an email using
SENDOBJECT. However the SendObject sends the complete Orders table as an
attachment.

How can I send the single record as email??

Regards

Liam Kitson
 
A

Albert D. Kallal

You need to build a report that shows the main part, and the details part.

You can then convert whole complex mess to a word attachment (rtf).

Keep the format simple, and clean..as the rtf format export does NOT export
graphics and logos.

Then, in code you can lanuch the reprot to the ONE record you are viewing,
adn then launch the meail client.

strReport = "InvoiceEmail"

me.Refresh
DoCmd.OpenReport strReport, acViewPreview, , "id = " & mybookingid
Reports(strReport).Visible = False

strEmailName = Nz(Me.EmailName, "")
strBodyText = "Hello " & Nz(Me.FullName)
strSubject = "Invoice from Joe Tools Company"

DoCmd.SendObject acSendReport, strReport, _
acFormatRTF, strEmailName, , , strSubject, strBodyText, True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top