Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send email code gives error message 1

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
I'm using this code with a button:

On Error GoTo Err_email_Click

Dim stDocName As String

stDocName = "MONTH_REPORT"
DoCmd.SendObject acSendReport, stDocName, "SnapshotFormat(*.snp)", "ssmallwood@maspac.local", "", "", [PM], "Hello, these are the PM's for the next month.", False, ""

Exit_email_Click:
Exit Sub

Err_email_Click:
MsgBox Err.Description
Resume Exit_email_Click


I keep getting this error message:

Microsoft Access can't find the field "|" referred to in your expression.

Don't understand why i'm getting that, any help appreciated!
 
What is [PM] ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Its meant to be the email Subject (probably in the wrong place or something). Its short for preventative maintenance.
 
Yep, it was the square brackets. Doh!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top