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

    Email form details as text (A97 )

    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"!!!!

    I have done this before using something similar to Post 188086 which uses this piece of code:
    DoCmd.SendObject acSendNoObject, , acFormatTXT, "",,,,"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?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 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, "", , , , 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