Forms & Subforms and email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Liam Kitson

    Forms & Subforms and email

    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


  • Albert D. Kallal

    #2
    Re: Forms & Subforms and email

    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 = "InvoiceEma il"

    me.Refresh
    DoCmd.OpenRepor t strReport, acViewPreview, , "id = " & mybookingid
    Reports(strRepo rt).Visible = False

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

    DoCmd.SendObjec t acSendReport, strReport, _
    acFormatRTF, strEmailName, , , strSubject, strBodyText, True


    --
    Albert D. Kallal (MVP)
    Edmonton, Alberta Canada
    pleasenonoSpamK allal@msn.com



    Comment

    Working...