Amp said:
***(Now that I reread it I feel like a didn't give a detailed enough of a
description)
I am using a table called "Unproccessed" as the record source for the
report
and as it loops I using the order number as the where condition to
populate
the desired report
strWhere = "[Order Number]='" & prmFilter & "'"
DoCmd.OpenReport prmRptName, , , strWhere, acHidden
I am using the outlook object model to create an email and attach the
report
out as a PDF. I was using Leban's Report to PDF method to convert the
report
to PDF and it works fine in a database that is not in a MS Access 2007
file
format
To answer your question yes, that is the case.
The SendObject didn't prompt for the PDF Save As, but it did give me the a
program is trying to send a email on your behalf warning (I forgot to add
that to the orginial post). In the environment I am using this code in I
can't modify Programmic Access or Macro Security in MS Outlook 2007 trust
center settings. Also it was sending the entire report and I couldn't
figure
out how to filter it.
The OutputTo worked as far as no prompt to save the PDF as fine but is has
no filter or where condition.......are you suggesting I filter the report
prior then use the attachment.add function to the email?
What would be the best way to filter the report?
Yes that's what I'm suggesting. Well there are a number of ways to do this,
so I'll pick the one that looks easiest to implement and we'll run with that
for starters. First of all, base the report on a query (SELECT * is fine),
not the table. Let's name it qryUnproccessed. When you want to filter the
report, rewrite the query's SQL string to add a where clause:
With CurrentDb.QueryDefs("qryUnproccessed")
.SQL = "SELECT Unproccessed.* From Unproccessed WHERE [Order Number]='"
& prmFilter & "'"
End With
(watch for word wrap)
Then use OutputTo as normal. One thing to remember is that the SQL is
permanently changed, so if you ever want an unfiltered report, you need to
pre-process it as above, but leaving out the where clause.
Hope that gets you off the ground.