<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Filtering Mailing Lists using Access and Outlook</title>
	<atom:link href="http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/</link>
	<description>Keeping Computers Happy Since 1997</description>
	<lastBuildDate>Mon, 30 Jan 2012 05:38:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Jeff Knapp</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2081</link>
		<dc:creator>Jeff Knapp</dc:creator>
		<pubDate>Mon, 03 May 2010 19:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2081</guid>
		<description>OK, you have a report, and you have a query.  (Make a backup of the query just so you have it.)

The code works fine, if you know how to edit SQL.  If not, your best bet is to write the query (with whatever input you want) and then copy that SQL to the routine.

Or, copy and paste the SQL here and I&#039;ll have a quick look.</description>
		<content:encoded><![CDATA[<p>OK, you have a report, and you have a query.  (Make a backup of the query just so you have it.)</p>
<p>The code works fine, if you know how to edit SQL.  If not, your best bet is to write the query (with whatever input you want) and then copy that SQL to the routine.</p>
<p>Or, copy and paste the SQL here and I&#8217;ll have a quick look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hazel Lowe</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2080</link>
		<dc:creator>Hazel Lowe</dc:creator>
		<pubDate>Mon, 03 May 2010 14:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2080</guid>
		<description>Hi Jeff, Thanks so much for your swift response, however the code fails on the SQL and because it fails before the MyQuery.Close I lose my original query and have to start over.  What is wrong with my SQL line?  Also I don&#039;t quite understand the references to email and emailaddress (should I be replacing these?  Also should I be removing my Like[Enter]&amp;&quot;*&quot; from my original query?</description>
		<content:encoded><![CDATA[<p>Hi Jeff, Thanks so much for your swift response, however the code fails on the SQL and because it fails before the MyQuery.Close I lose my original query and have to start over.  What is wrong with my SQL line?  Also I don&#8217;t quite understand the references to email and emailaddress (should I be replacing these?  Also should I be removing my Like[Enter]&amp;&#8221;*&#8221; from my original query?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Knapp</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2079</link>
		<dc:creator>Jeff Knapp</dc:creator>
		<pubDate>Mon, 03 May 2010 12:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2079</guid>
		<description>You can fake it by setting your report recordsource to a query and then re-write the query from the code and then do the export from there.  Since we have to rely on DoCmd in Access sometimes, we&#039;re robbed of some flexibility as to what we can pass.

Perhaps there&#039;s an easier way, but this seems most direct:

I have a report, REPORT1 and it has a RecordSource of a query called &quot;REPORTSOURCE&quot;.  You have saved a variable called YourVariable somewhere, use it when you rewrite your query:

            Dim MyQuery As QueryDef
            Set MyQuery = CurrentDb.QueryDefs(&quot;ReportSource&quot;)
            MyQuery.SQL = &quot;select * from emails where emailaddress = &#039;&quot; &amp; YourVariable &amp; &quot;&#039;&quot;
            MyQuery.Close

And then run your export and attach as usual.

You can get the SQL from the QueryDef from the Query Designer in Access, just go into SQL view and then cut and paste into your code module.</description>
		<content:encoded><![CDATA[<p>You can fake it by setting your report recordsource to a query and then re-write the query from the code and then do the export from there.  Since we have to rely on DoCmd in Access sometimes, we&#8217;re robbed of some flexibility as to what we can pass.</p>
<p>Perhaps there&#8217;s an easier way, but this seems most direct:</p>
<p>I have a report, REPORT1 and it has a RecordSource of a query called &#8220;REPORTSOURCE&#8221;.  You have saved a variable called YourVariable somewhere, use it when you rewrite your query:</p>
<p>            Dim MyQuery As QueryDef<br />
            Set MyQuery = CurrentDb.QueryDefs(&#8220;ReportSource&#8221;)<br />
            MyQuery.SQL = &#8220;select * from emails where emailaddress = &#8216;&#8221; &amp; YourVariable &amp; &#8220;&#8216;&#8221;<br />
            MyQuery.Close</p>
<p>And then run your export and attach as usual.</p>
<p>You can get the SQL from the QueryDef from the Query Designer in Access, just go into SQL view and then cut and paste into your code module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hazel Lowe</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2077</link>
		<dc:creator>Hazel Lowe</dc:creator>
		<pubDate>Mon, 03 May 2010 09:49:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2077</guid>
		<description>I use code:
DoCmd.RunSavedImportExport (&quot;ReportName&quot;)

This avoids all the prompts coming up when exporting.
Then I import these onto the email with:
MyMail.Attachments.Add &quot;path/Report.rtf&quot;

I have now managed to save the user input in a table, but I am stumped again as to how to use the table data in a query without yet another inputbox coming up.</description>
		<content:encoded><![CDATA[<p>I use code:<br />
DoCmd.RunSavedImportExport (&#8220;ReportName&#8221;)</p>
<p>This avoids all the prompts coming up when exporting.<br />
Then I import these onto the email with:<br />
MyMail.Attachments.Add &#8220;path/Report.rtf&#8221;</p>
<p>I have now managed to save the user input in a table, but I am stumped again as to how to use the table data in a query without yet another inputbox coming up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Knapp</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2059</link>
		<dc:creator>Jeff Knapp</dc:creator>
		<pubDate>Sat, 01 May 2010 15:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2059</guid>
		<description>Hazel, I guess the first question I have is &quot;how are you attaching the report to the email&quot; ?</description>
		<content:encoded><![CDATA[<p>Hazel, I guess the first question I have is &#8220;how are you attaching the report to the email&#8221; ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hazel Lowe</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2058</link>
		<dc:creator>Hazel Lowe</dc:creator>
		<pubDate>Sat, 01 May 2010 13:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2058</guid>
		<description>Jeff, Really appreciate your swift reply.  Since your reply on the 26th, however, I have now struggled to do what you suggest.  I must have spent hours on the internet trying to decipher how to pass a parameter from VBA to a query.  There are too many geeks out there trying to show off their advanced knowledge, and we beginners have little hope of understanding more than 1% of what they have to say.  I don&#039;t expect others to do all the work for me but it would be helpful if you could elaborate on your previous reply.  I think I have to go with the create a parameter object (think I&#039;ve done that via my first Inbox response) but what do I put in the query to use this response?</description>
		<content:encoded><![CDATA[<p>Jeff, Really appreciate your swift reply.  Since your reply on the 26th, however, I have now struggled to do what you suggest.  I must have spent hours on the internet trying to decipher how to pass a parameter from VBA to a query.  There are too many geeks out there trying to show off their advanced knowledge, and we beginners have little hope of understanding more than 1% of what they have to say.  I don&#8217;t expect others to do all the work for me but it would be helpful if you could elaborate on your previous reply.  I think I have to go with the create a parameter object (think I&#8217;ve done that via my first Inbox response) but what do I put in the query to use this response?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Knapp</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-2014</link>
		<dc:creator>Jeff Knapp</dc:creator>
		<pubDate>Mon, 26 Apr 2010 15:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-2014</guid>
		<description>You can pass parameters to a query, so the user only has to be asked once, and then you can pass their answer as many times as you want.

Basically, you create a parameter object and pass it to the query object and then execute the query.

Or you might be able to -- instead of executing the query --  make that query the recordsource for the report.</description>
		<content:encoded><![CDATA[<p>You can pass parameters to a query, so the user only has to be asked once, and then you can pass their answer as many times as you want.</p>
<p>Basically, you create a parameter object and pass it to the query object and then execute the query.</p>
<p>Or you might be able to &#8212; instead of executing the query &#8212;  make that query the recordsource for the report.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hazel Lowe</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-1973</link>
		<dc:creator>Hazel Lowe</dc:creator>
		<pubDate>Wed, 21 Apr 2010 12:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-1973</guid>
		<description>Firstly, thanks for your invaluable coding for sending emails from Access 2007.  I have managed to output an email to outlook, and add an attachment.  However the attachment is a report (using a query with Like[enter] etc, and thus the user will need to input their required contact name twice, once for the email and once for the attachment.  Is there anyway that I can populate the second InputBox from the result of the first?</description>
		<content:encoded><![CDATA[<p>Firstly, thanks for your invaluable coding for sending emails from Access 2007.  I have managed to output an email to outlook, and add an attachment.  However the attachment is a report (using a query with Like[enter] etc, and thus the user will need to input their required contact name twice, once for the email and once for the attachment.  Is there anyway that I can populate the second InputBox from the result of the first?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Knapp</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-843</link>
		<dc:creator>Jeff Knapp</dc:creator>
		<pubDate>Thu, 30 Jul 2009 17:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-843</guid>
		<description>You would need to call a query each time through the loop.

So you have the first query which provides all the email addresses, then you&#039;d need to run a second query which uses information (UserID, email address, whatever) from the first quer to pull out whatever information you need.

Unfortunately, this isn&#039;t something I&#039;m able to write up in great detail right now, but I&#039;ll put it on the list for a new article.</description>
		<content:encoded><![CDATA[<p>You would need to call a query each time through the loop.</p>
<p>So you have the first query which provides all the email addresses, then you&#8217;d need to run a second query which uses information (UserID, email address, whatever) from the first quer to pull out whatever information you need.</p>
<p>Unfortunately, this isn&#8217;t something I&#8217;m able to write up in great detail right now, but I&#8217;ll put it on the list for a new article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandisa Sizane</title>
		<link>http://www.jephens.com/2009/04/07/filtering-mailing-lists-using-access-and-outlook/comment-page-1/#comment-842</link>
		<dc:creator>Mandisa Sizane</dc:creator>
		<pubDate>Thu, 30 Jul 2009 14:38:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jephens.com/?p=159#comment-842</guid>
		<description></description>
		<content:encoded><![CDATA[<p>Please assist me on how to send an automated email to different users and attach a report that has filtered only that user’s information automatically, without sending other peoples information. I’m using MS Access 2007.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

