Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access - How do you insert a date function in the subject line of the SendObject

Posted on 2010-09-01
2
Medium Priority
?
937 Views
Last Modified: 2012-05-10
I have a macro that uses SendObject to e-mail reports on a monthly basis.  Is there a way to insert the =Date() function or the month part of the date into the Subject line of the SendObject?
0
Comment
Question by:TFHDIT
[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
2 Comments
 
LVL 20

Accepted Solution

by:
hes earned 500 total points
ID: 33580339
Use a variable for your Subject Line

Dim strEmailTO As String
   Dim strEmailCC As String
   Dim strEmailBCC As String
   Dim strSubject1 As String
   Dim strSubject2 As String
   Dim strBodyText As String

'Populate each variable with email addresses or titles
strSubject1 = "This report is for "
strSubject2 = " Date..."


DoCmd.SendObject acSendReport, "Report Name", acFormatRTF, strEmailTO, strEmailCC, strEmailBCC, strSubject1 & " " & Now() & " " & strSubject2 & " ", strBodyText, 0
0
 
LVL 6

Expert Comment

by:PJBX
ID: 33687866
Use a variable and the format comand:
dim strSubject as string
'If you want just the abbreviated month (Ex: Payables report for: Sep)
strSubject = "Payables report for: " & Format(Now(), "MMM")

'If you want the full month (Ex: Payables report for: September)
strSubject = "Payables report for: " & Format(Now(), "MMMM")

0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

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…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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