Solved

Emailing a form as plain text.

Posted on 2009-05-05
4
654 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

752 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