Solved

Emailing a form as plain text.

Posted on 2009-05-05
4
659 Views
Last Modified: 2013-11-28
I have some reports I email as plain text. Because of the size of the body I created a table with a memo field so I can reference the table and record to insert into the body for that particular form. How do I go about referencing the table and record that I want shown in the body of the email?

I would like to replace the text

"Your support request has been resolved - If you require additional action or have questions regarding this case please reply to this email with a detailed explanation."

with the value in the memo field from table "strings" record "1"
'------------------------------------------------------------
' cmdEmail_Click
'
'------------------------------------------------------------
Private Sub cmdEmail_Click()
On Error GoTo cmdEmail_Click_Err
 
    On Error Resume Next
    DoCmd.SendObject , "", "", DLookup("[E-mail Address]", "Users", "ID = " & Forms![Call Details]!Caller), "", "", Replace(Replace("Call |1: |2", "|1", Nz(ID, "")), "|2", Nz(Title, "")), IIf(Form.Description.TextFormat = 1, PlainText(Description), Description) + Chr(13) + Chr(10) + "Your support request has been resolved - If you require additional action or have questions regarding this case please reply to this email with a detailed explanation.", True, ""
    If (MacroError.Number <> 0) Then
        Beep
        MsgBox MacroError.Description, vbOKOnly, ""
    End If
 
 
cmdEmail_Click_Exit:
    Exit Sub
 
cmdEmail_Click_Err:
    MsgBox Error$
    Resume cmdEmail_Click_Exit
 
End Sub

Open in new window

0
Comment
Question by:timamartin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 24308446
timamartin

You did not specify two key pieces of info:
1. The Name of the field
2. The Specfic Criteria.

So try something like this.
It finds the Value in the "Strings" table in the "YourField" Field, Where the "Record" field is equal to 1
You will have to substitute the missing value for the ones I used ("YourTable" and "Record")


   DoCmd.SendObject , "", "", DLookup("[E-mail Address]", "Users", "ID = " & Forms![Call Details]!Caller), "", "", Replace(Replace("Call |1: |2", "|1", Nz(ID, "")), "|2", Nz(Title, "")), IIf(Form.Description.TextFormat = 1, PlainText(Description), Description) + Chr(13) + Chr(10) + DLookup("YourField", "Strings", "Record=" & 1), True, ""


JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24308449
Full string as well.
DoCmd.SendObject , "", "", DLookup("[E-mail Address]", "Users", "ID = " & Forms![Call Details]!Caller), "", "", Replace(Replace("Call |1: |2", "|1", Nz(ID, "")), "|2", Nz(Title, "")), IIf(Form.Description.TextFormat = 1, PlainText(Description), Description) + Chr(13) + Chr(10) + DLookup("YourField", "Strings", "Record=" & 1), True, ""

Open in new window

0
 

Author Comment

by:timamartin
ID: 24647433
This worked well -- thank you very much!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24650912
;-)
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question