Results 1 to 2 of 2
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Email form details as text (A97 )

    Background
    I have a colleague who has created a very basic Access database which has a single table with a list of contractors. He approached me yesterday asking if it was possible to send the details of a new contractor to managers via email. I said "Yes"!!!!

    Problem
    I have done this before using something similar to Post 188086 which uses this piece of code:
    DoCmd.SendObject acSendNoObject, , acFormatTXT, "TheBoss@mywork.com",,,,"the workorder is "& forms!myform!workorder

    This is fine if you want to send out one fields worth of information in text format but I would like to put several fields worth of info. such as Contractors name, address, telephone number, email etc in a format that makes it easy to read on an email. Is this possible?

    I suppose I could append &forms!myform!contractor but then all I get is a long string of gobbledigook. Is there a command to force a line break in between them?
    Jerry

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Email form details as text (A97 )

    You can use vbCrLf to insert a line break into a string, for example:

    Dim strMessage As String

    strMessage = ",,,,"The workorder is "& forms!myform!workorder & vbCrLf & _
    "Contractor: " & forms!myform!contractor & vbCrLf & vbCrLf & _
    "Yours sincerely," & _
    "(name here)"

    DoCmd.SendObject acSendNoObject, , acFormatTXT, "TheBoss@mywork.com", , , , strMessage

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •