send an e-mail with current record

A

artist

I setup a report showing one record. I want this report to be e-mailed when
I push a button on a form. It is not working using mywherecondition. Here
is the code:

Dim MyWhereCondition As String

MyWhereCondition = "ScheduleID= " & Me.ScheduleID
DoCmd.OpenReport "rptScheduleForm", acPreview, MyWhereCondition
DoCmd.SendObject acSendReport "rptscheduleform",
*.xml,[email protected]

Can someone please help?
 
A

artist

I put in the second comma, but the next line of code is causing problems.
The DoCmd.SendObject is not working.

Any idea what is wrong?

Thank you for your help!
 
S

sergi

artist said:
I setup a report showing one record. I want this report to be e-mailed
when
I push a button on a form. It is not working using mywherecondition.
Here
is the code:

Dim MyWhereCondition As String

MyWhereCondition = "ScheduleID= " & Me.ScheduleID
DoCmd.OpenReport "rptScheduleForm", acPreview, MyWhereCondition
DoCmd.SendObject acSendReport "rptscheduleform",
*.xml,[email protected]

Can someone please help?
 

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