change e-mail subject

G

Guest

Does anyone know how to change the subject of an access generated email to
reflect whatever is in a table field? This is what I have. I reports that
are auto-sent and I would like the subject to change to match whatever the
user types in the table. Any suggestions is appreciated. Thanks!

Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
strRecipient = strEmail
strSubject = Reports(strOpenbankacct).Caption
strMessageBody = [Forms]![message].[Body]
DoCmd.SendObject acSendReport, strOpenbankacct, acFormatSNP,
strRecipient, , , strSubject, strMessageBody, False
SendReportByEmail = True
 
C

Carl Rapson

Stacey said:
Does anyone know how to change the subject of an access generated email to
reflect whatever is in a table field? This is what I have. I reports
that
are auto-sent and I would like the subject to change to match whatever the
user types in the table. Any suggestions is appreciated. Thanks!

Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
strRecipient = strEmail
strSubject = Reports(strOpenbankacct).Caption
strMessageBody = [Forms]![message].[Body]
DoCmd.SendObject acSendReport, strOpenbankacct, acFormatSNP,
strRecipient, , , strSubject, strMessageBody, False
SendReportByEmail = True

You could use DLookUp:

strSubject = DLookUp("field","table","criteria")

Carl Rapson
 
G

Guest

Carl, I also solved it.....you don't even want to know what I did. I like
your solution a heck of a lot more...so easy! I'm changing what I did to
reflect the DLookup solution. Thanks!! For keeping it simple! =)

Carl Rapson said:
Stacey said:
Does anyone know how to change the subject of an access generated email to
reflect whatever is in a table field? This is what I have. I reports
that
are auto-sent and I would like the subject to change to match whatever the
user types in the table. Any suggestions is appreciated. Thanks!

Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
strRecipient = strEmail
strSubject = Reports(strOpenbankacct).Caption
strMessageBody = [Forms]![message].[Body]
DoCmd.SendObject acSendReport, strOpenbankacct, acFormatSNP,
strRecipient, , , strSubject, strMessageBody, False
SendReportByEmail = True

You could use DLookUp:

strSubject = DLookUp("field","table","criteria")

Carl Rapson
 

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