title: Attaching access form and subform data in mail body
body: <p>Thanks in advance :), I am trying to attach the data of subform also in mail body.</p>
  
  <p>Current Status: I am able to attach Main forms data and generate mail but unable to attach subform's data as it only includes the first row, Tryied doing it through Subform and query both but no success. I will prefer to do it by subform itself. Subform's Name is : "subUpdateOrder". VB Code:</p>
  
  <pre><code>Private Sub InformCustomer_Click()
  
  On Error GoTo Err_InformCustomer_Click
  
      Dim CustName As String      ' Customer Name
      Dim varTo As Variant        '-- Address for SendObject
      Dim stText As String        '-- E-mail text
      Dim DelDate As Variant      '-- Rec date for e-mail text
      Dim stSubject As String     '-- Subject line of e-mail
      Dim stOrderID As String     '-- The Order ID from form
      Dim detailQry As String
      'Dim stHelpDesk As String    '-- Person who assigned ticket
      'Dim strSQL As String        '-- Create SQL update statement
      'Dim errLoop As Error
  
      CstName = Me![CustName]
      varTo = Me![CustEmail]
      stSubject = ":: Update - Oder Status ::"
      stOrderID = Me.[OdrID]
      DelDate = Me.[OdrDeliveryDate]
      stText = "Dear" &amp; CstName &amp; _
               "You have been assigned a new ticket." &amp; Chr$(13) &amp; Chr$(13) &amp; _
               "Order Number: " &amp; stOrderID &amp; Chr$(13) &amp; _
               "Please refer to your order status " &amp; Chr$(13) &amp; _
               "Exp Delevery Date: " &amp; DelDate &amp; Chr$(13) &amp; Chr$(13) &amp; _
                dQuery &amp; Chr$(13) &amp; _
               "This is an automated message. Please do not respond to this e-mail."
  
      'Write the e-mail content for sending to assignee
      DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, True
    Err_InformCustomer_Click:
      MsgBox Err.Description
  End Sub
  </code></pre>
  
  <p>Form Img: <a href="http://i.stack.imgur.com/3EoPe.png" rel="nofollow">Form and Command1 button to run the code</a></p>