e-mailing a single record in a report

e-mailing a single record in a report

am 09.04.2008 21:04:21 von AmateurDBer

Hello, I'm looking for Allen.

I hate to bother you again, but I am now trying to e-mail the single
record from the same form mentioned before (using a macro button) (reference
thread about printing a single record in a report form - worked great, thanks!
).

I found some previous advice you provided on the same subject and came up
with:

Private Sub cmdEmail_Click()
If IsNull(Me.ID) Or IsNull(Me.Email) Then
MsgBox "Need ID and email"
Else
gstrReportFilter = "Record ID = " & Me.Record_ID
DoCmd.SendObject acSendReport, "rpt Worksheet e-mail", "FormTyp",
acFormatHTML, "xyz@abc.com", "xyz@abc.com", , "Company Name"
Me.Email , True
End If
End Sub

When I run this, I get "Compile error: Invalid use of Me keyword" and it
highlights the first reference of "ME".

Also, in the subject line, how do I get it to enter the data from one of the
fields in the report? if possible.

Thanks in advance,
Newbie aka Valarie

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-ac cess/200804/1