Defining Subject Line in an Email from a field in the report

  • Thread starter AccessUser777 via AccessMonster.com
  • Start date
A

AccessUser777 via AccessMonster.com

Hello all,
Is there a way to add the value of a field to the subject line when emailing
a report from access?
 
M

Mark Andrews

I'm sure you can build the subject via code if you are using
DoCmd.SendObject. Just use a variable to store the subject and construct it
in code however you want (before you call the DoCmd.SendObject).
Dim strSubject as String
strSubject = "blah blah blah " & Me.txtCustomerName

DoCmd.SendObject ObjectType, ObjectName, OutputFormat, To, Cc, Bcc,
strSubject, MessageText, EditMessage, TemplateFile

You could also take a look at the email module at www.rptsoftware.com it is
designed to allow you to build email templates into your database.
Example:
TO: ##Email##
From: (e-mail address removed)
Subject: Sales for Customer ##CustomerName##
Body:
Thank you for your business. we have the following information on file:
Name: ##CustomerName##
Address: ##Address##
etc...

All the variables get substituted at runtime to build and send the emails.

HTH,
Mark Andrews
RPT Software
http://www.rptsoftware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top