By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 993 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

EMAILING A REPORT AS ATTACHMENT LINKED TO A SPECIFIC RECORD IN A FORM

P: n/a
I have a report with it's source from a query. The query calls data
from 3 related tables. The report is a meeting agenda and I only want
to attach a snapshot report to my email based on the specific record
on a form. I tried using stLinkCriteria but it always captures all
the records on my query as one snapshot attachment with all the
records. The only way I can filter the record I wanted was to add a
field to my table that users manually set to "Yes" and the query
criteria set to "Yes". After sending the email, my users have to
uncheck the Yes box. I would like to not use this option. Help
please!

Fred Crisostomo

May 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It's hard to answer, without knowing _how_ you are sending the email.

There are any number of ways to go about opening a bound object with a
filter condition, the easiest is:
DoCmd.OpenReport "asdf", WhereCondition:="fieldName='" &
me.txtFilterCond & "'"

but depending on how you are emailing the report, you may not have the
option to specify a WhereCondition. In this case a possible route is
to alter your report's underlying query on the fly. Something like:

'Alter the reports recordsource query
dim qry as dao.querydef
set qry = currentdb.QueryDefs("qryBoundQuery")
qry.sql = "Select * from qryBaseQuery Where fieldName="' &
me.txtFilterCond & "'"

'Do your email thing
call emailSub

May 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.