Reports as attachments

N

Nicole

I am attempting to follow the instructions found at the following link:

http://www.granite.ab.ca/access/email/reportsasattachments.htm

I am very stuck. The instructions don't seem to advise on how to send an
email after a certain field on my form is updated. That's o.k., because I
already know how to. I'm using this code to do it.

SendTo = "(e-mail address removed)"
MySubject = "Updated Status Report"
MyMessage = "A Project Status update has been provided for the following
project: " & Me![Proj Name] & Chr$(13) & Chr$(10) & "Please see the attached
report."
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, False

This is all I needed to do before. Now I need to attach the report to the
email too. Soooo, I'm trying to use the following:

DoCmd.OutputTo acOutputReport, "Status Report 3", "Snapshot Format",
"C:\NicolesTest", False

With just this code nothing happens.

Aside: The path name C:\NicolesTest is just temporary until I can get the
code working. What I really want to do is send this file to a network
folder, but I'm trying to take one step at a time. I'm afraid I'll run into
problems trying to accomplish that, but will research it separately if needed.

This is the part that's confusing me...

As advised, I want to put the following in my report's OnOpen event.

Me.Filter = "ShipmentsID=" & Forms![Select Load List]![LoadID]
Me.FilterOn = True

Where ShipmentsID is supposed to be a field in the underlying recordsource
of the form. I'm trying to create a filter that will only return those rows
where ShipmentsID is the same value as what's in a control named LoadID on a
form named Select Load List.

My form's name is Status Report 3 (same name as the name of my report. I
know, goofy, but I have to work with it for now). I have a primary key field
named Report No on both my Form and Report. So I'm thinking my code should
look like this.

Me.Filter = "Report_No=" & Forms![Status_Report_3]![Report_No]
Me.FilterOn

I can't even compile this. I get the error "Invalid use of property for
FilterOn.

I'm stuuuuuck.
 

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