MAG,
I'm working on this for the first time as well. I'm trying to send the
current record and I have it working fine. I think my code might be a bit
simplistic, but it's working...
On Error Resume Next
DoCmd.SendObject acSendReport, ,acFormatHTML, , , ,"Service Request",,False
It's my understanding that if you leave the ObjectName blank, then it just
uses the current record. Like I said before though, I'm new to this as well,
so there may be other ways I just don't know about.
HTH
Aaron G
Philadelphia, PA
MAG said:
Steve,
I have a Service Request form that I have sent up to be filled out and an
email command button that automatically sends the form to the Service
Department. I have set it up as Send Object and it works, but I can't get it
to send just the current record, it sends all records. I have tried a lot of
different things, but I am not experienced enough in Access to make it work.
Thanks for your help.
MAG
Steve Schapel said:
MAG,
It is not clear what you are trying to do. The OpenReport method
notrmally applies to printing or previewing the report. There is no
acOutputReport option applicable to the View argument. If you are
trying to output the report to a file and send as an email attachment,
the SendObject method may be applicable. Check it out. If you still
need help after that, can you give more details of what you want to achieve.
As a completely tangential side issue... it is not a good idea to use a
# as part of the name of a field or control.
--
Steve Schapel, Microsoft Access MVP
MAG wrote:
I am still trying to get my form e-mail command button to only send the
current record. I am either receiving error messages or my command button
doesn't work. This is what I have:
Private Sub cmdSendReport_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "rptSendObject"
strCriteria = "[WorkOrder#]='" & Me![WorkOrder#] & " ' "
DoCmd.OpenReport strReportName, acOutputReport, , strCriteria
End Sub