<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Clint Covington: Software design, Microsoft Office Access : Samples</title><link>http://blogs.msdn.com/clintcovington/archive/tags/Samples/default.aspx</link><description>Tags: Samples</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to pull in Amazon web service data into Access 2007</title><link>http://blogs.msdn.com/clintcovington/archive/2007/03/12/how-to-pull-in-amazon-web-service-data-into-access-2007.aspx</link><pubDate>Tue, 13 Mar 2007 09:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1870144</guid><dc:creator>Clint Covington</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/clintcovington/comments/1870144.aspx</comments><wfw:commentRss>http://blogs.msdn.com/clintcovington/commentrss.aspx?PostID=1870144</wfw:commentRss><description>&lt;P&gt;Today’s guest writer is Ric Lewis. Several weeks ago&amp;nbsp;he started a &lt;A href="http://blogs.msdn.com/clintcovington/archive/2007/02/20/web-service-discussion-and-sample-book-database-that-uses-amazon-s-web-services.aspx" mce_href="http://blogs.msdn.com/clintcovington/archive/2007/02/20/web-service-discussion-and-sample-book-database-that-uses-amazon-s-&amp;#13;&amp;#10;&amp;#13;&amp;#10;web-services.aspx"&gt;general discussion&lt;/A&gt; about web services which turned out to be a popular post. This week he is providing the details of the books sample database.&lt;/P&gt;
&lt;P&gt;It would be sweet if someone takes this project and details it out a bit further. For example, you could imagine using the title to search for titles and popping up a list of search results to choose from. The ISBN number is a bit awkward. If you do make improvements to the project—send me an email and I will share it with the community.&lt;/P&gt;
&lt;P&gt;Clint&lt;/P&gt;
&lt;H3&gt;Amazon Web Service Code Sample&lt;/H3&gt;
&lt;P&gt;As a note before you dig in, the code presented in this post consists of excerpts from the full project code. In other words, if you’re going to copy and paste my stuff, do it from the project, not from this post. You can grab the code for this project from here: &lt;A class="" href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip" mce_href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip"&gt;Code Project&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;For those of you who want to compile and run the plugin, here are the steps:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can grab the code for this project from here: &lt;A class="" href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip" mce_href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip"&gt;Code Project&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Get a new Amazon Web Service key from the &lt;A class="" href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html" mce_href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html"&gt;Amazon Developer Center&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Replace the “############” in the DataCollector.cs code file with your new AmazonWS key (the code won't compile until you complete this step).&lt;/LI&gt;
&lt;LI&gt;Build the AmazonDemoAddinSetup project.&lt;/LI&gt;
&lt;LI&gt;Run the setup.exe file generated (this will install the plugin so Access can see it).&lt;/LI&gt;
&lt;LI&gt;Visual Studio will generate an AmazonDemoAddIn.dll.config file in the build directory.&amp;nbsp; Copy this file “\program files\microsoft office\office12” and rename it “msaccess.exe.config”&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Also, this post has no pictures. Not one. So if you like pictures, look elsewhere, if you like code snippets, venture on. Okay, with that out of the way, let’s talk about this application.&lt;/P&gt;
&lt;H3&gt;Form Load&lt;/H3&gt;
&lt;P&gt;I’m all about flow-of-control discussions, so let’s trek through the app in that manner.&lt;/P&gt;
&lt;P&gt;When you load up Access, it determines which, if any, add-ins have been installed and should be loaded. Thereafter you can reference those add-ins by name from your form’s VBA code.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Load up the Book database (from the previous post or the code project above), and you can click on the “New Book” button.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This triggers a call to the &lt;B style="mso-bidi-font-weight: normal"&gt;Form_Load&lt;/B&gt; event handler in VBA code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There’s not too much VBA, so let’s step you through the code:&lt;/P&gt;
&lt;P&gt;This first bit of code &lt;I&gt;opens the form&lt;/I&gt;, checking first to see if it’s a new form, or an existing record.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;Private Sub Form_Load() &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If (Not IsNull(Me.OpenArgs)) Then &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;DoCmd.GoToRecord , "", acNewRec &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Me.Title = Me.OpenArgs &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;End If &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If this is a new form, or there’s just no name, then &lt;I style="mso-bidi-font-style: normal"&gt;set a title for the book&lt;/I&gt;. This form requires a title to be set, so it’s nice to get this out of the way upfront.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If (IsNull(Me.Title)) Then &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Me.Title = "Untitled" &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;End If &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This just places the cursor in the ISBN field. You probably knew that.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Me.ISBN.SetFocus &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;This last bit of code is the interesting part.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It connects &lt;I style="mso-bidi-font-style: normal"&gt;to my addin&lt;/I&gt; (AmazonDemoAddIn) and &lt;I style="mso-bidi-font-style: normal"&gt;calls the PrepareObject&lt;/I&gt; function of my add-in.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We won’t go into this function too much, but it warms up the web proxy that we’ll be using later.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;With COMAddIns("AmazonDemoAddIn.Connect") &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;' make sure the COM add-in is loaded &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;.Connect = True &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;'warm up the web proxy object--this may take a few seconds &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;.Object.PrepareObject &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;End With &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;End Sub &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;(This PrepareObject call is why the form is so slow when loading for the first time)&lt;/P&gt;
&lt;H3&gt;ISBN AfterUpdate&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;So, now the “New Book” form is up, with an eager cursor, blinking away, waiting for you to enter an ISBN. Type in an ISBN, leave the ISBN text box and it will trigger the &lt;STRONG&gt;ISBN_AfterUpdate&lt;/STRONG&gt; code back in our VBA macros&lt;/P&gt;
&lt;P&gt;Up to this point, we have a &lt;I&gt;form for a new record&lt;/I&gt;, but we have not yet generated &lt;I&gt;a new recordset in the database&lt;/I&gt;. The &lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;Me.Form.Refresh&lt;/SPAN&gt; call will generate an actual recordset in the database, so we have something to pass into our add-in.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;Private Sub ISBN_AfterUpdate() &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Title = "Retrieving from Amazon..."&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Dirty = False&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Up to this point, we have a &lt;I style="mso-bidi-font-style: normal"&gt;form &lt;/I&gt;for a new record, but we have not yet generated &lt;I style="mso-bidi-font-style: normal"&gt;a new recordset in the database&lt;/I&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The &lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;Me.Dirty&lt;/SPAN&gt; call will generate an actual recordset in the database, so we have a recordset we can pass into our add-in.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;With COMAddIns("AmazonDemoAddIn.Connect") &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;.Connect = True &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;' Hook up the desired objects &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;If Not .Object.FillInBookForm(Me.ISBN, Me.Recordset) Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Title = "Failed to retrieve from Amazon."&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;End With &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Me.Form.Refresh &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;End Sub &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;This bit of code brings up an important point.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;I&gt;There are two ways to manipulate your form from your managed add-in:&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Top-down: Pass in a control from your form (e.g. Me.ISBN) and manipulate its properties in your managed add-in.&lt;/LI&gt;
&lt;LI&gt;Bottom-up: Pass in your form’s recordset and manipulate the record set.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;For reasons too complex to get into here, if you’re adding complex data (for example, a new attachment) you’ll need to pass in the recordset. However, if your forms only contain textual data, most of that can (and probably should) be handled by manipulation of the controls.&lt;/P&gt;
&lt;P&gt;Okay, on to the managed add-in code.&lt;/P&gt;
&lt;H3&gt;Managed Add-in&lt;/H3&gt;
&lt;P&gt;Over-simplified data flow of my AddIn.Connect class is as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Grab ISBN control and Recordset passed in from VBA form code&lt;/LI&gt;
&lt;LI&gt;Send ISBN value to a DataCollector object (Amazon, in this case)&lt;/LI&gt;
&lt;LI&gt;DataCollector returns a Book object&lt;/LI&gt;
&lt;LI&gt;Populate Recordset with information from Book object&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So let’s, look at how each of those parts happens:&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;STRONG&gt;Grab parameters from VBA form code&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Remember this call from our form VBA?&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;.Object.FillInBookForm Me.ISBN, Me.Recordset&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This calls the following function in our AddIn:&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; FillInBookForm(Access.&lt;SPAN style="COLOR: #2b91af"&gt;TextBoxClass&lt;/SPAN&gt; ISBNTextBox, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-background-themecolor: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Recordset2&lt;/SPAN&gt; FormRS) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;STRONG&gt;Send ISBN to a DataCollector (Amazon, in this case)&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;From here, we call CollectInfoFromWeb.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This function checks if we have a DataCollector setup (we do), makes sure that the ISBN isn’t empty, and sends the ISBN on to the &lt;B style="mso-bidi-font-weight: normal"&gt;DataCollector.&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Note that we’re accessing the &lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;.Text&lt;/SPAN&gt; property of the ISBNTextBox control.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This returns the text that’s currently occupies the ISBN control back in our form.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Book&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; tempBook = CollectBookInfoFromWeb(ISBNTextBox.Text); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;STRONG&gt;DataCollector returns a Book object&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;This is where lots of magic happens.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;The DataCollector always sends back “Book” objects.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You should be able to extend the DataCollector class to gather data from any Web Service you’d like (eBay comes to mind), as long as you somehow squeeze all the return data into a “Book” object.&lt;/P&gt;
&lt;P class=MsoNormal&gt;If you’ve installed the .NET 3.0 extensions for Visual Studio 2005 (here:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D&lt;/A&gt;) from within Visual Studio you can add a reference to any WSDL-based Web Service just by pointing it to the WSDL.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Simply right-click on your project, select “Add Service Reference” and type your WSDL into the form and Visual Studio will auto-generate a bunch of code for interacting with the service.&lt;/P&gt;
&lt;P&gt;Once you’ve got the Service Reference added to your project, you’ll have a proxy class which you can instantiate to interact with the web service.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 10pt 0.5in; mso-background-themecolor: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;AmazonClient = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;AWSECommerceServicePortTypeClient&lt;/SPAN&gt;();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Note:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;all the configuration, binding and connection info for this proxy client is put in your project’s app.config file.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This becomes the AmazonAddInDemo.dll.config file at build time, and needs to be renamed &lt;SPAN style="COLOR: #0070c0"&gt;msaccess.exe.config&lt;/SPAN&gt; copied to the directory alongside your MSACCESS.exe.&lt;/P&gt;
&lt;P&gt;One of the methods on this proxy is ItemLookup. This call takes an ItemLookupRequest object as a parameter, so you’ll need to generate and fill out the properties of that object:&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ItemLookupRequest&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; lookupRequest = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ItemLookupRequest&lt;/SPAN&gt;(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;lookupRequest.ItemId[0] = myISBNString; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;lookupRequest.SearchIndex = &lt;SPAN style="COLOR: #a31515"&gt;"Books"&lt;/SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Then make your call to ClientProxy.ItemLookup, and store the result as an ItemLookupResponse object:&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ItemLookupResponse &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;myResponse = &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;mAmazonClient.ItemLookup(itemLookup);&lt;/SPAN&gt;&lt;I style="mso-bidi-font-style: normal"&gt; &lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Then, lastly, we’ll map the properties from the response object into a new Book object.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;newBook = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Book&lt;/SPAN&gt;(currentItem.ItemAttributes.Title, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Author, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;currentItem.ItemAttributes.Genre, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;…); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; newBook;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;STRONG&gt;Populate Recordset with information from Book object&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;We call .Edit() on the recordset we were sent (FormRS), and start plugging values into fields&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;FormRS.Edit(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;FormRS.Fields[&lt;SPAN style="COLOR: #a31515"&gt;"Author"&lt;/SPAN&gt;].Value = tempBook.author; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;FormRS.Fields[&lt;SPAN style="COLOR: #a31515"&gt;"Title"&lt;/SPAN&gt;].Value = tempBook.title; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;… &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Then for some real magic, we embed the cover art data into the recordset.&lt;/P&gt;
&lt;P&gt;Internally, Access sees Attachments (like our cover art field), as embedded child recordsets (sub-tables). So, we’ll need to create a new record in the “Attachments” child recordset.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Field2&lt;/SPAN&gt; fld = &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 2in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-background-: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Field2&lt;/SPAN&gt;)FormRS.Fields[&lt;SPAN style="COLOR: #a31515"&gt;"Attachments"&lt;/SPAN&gt;]; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 1.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Recordset2&lt;/SPAN&gt; rstChild = &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 2in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-background-: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;(Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Recordset2&lt;/SPAN&gt;)fld.Value; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 2in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-background-: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;rstChild.AddNew(); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;And then dump our binary image data into the “FileData” field of this new record (from the URL of the image data), update the “Attachments”sub-recordset, the form’s recordset, and we’re good to go.&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Field2&lt;/SPAN&gt; fldChild = &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 2in; LINE-HEIGHT: normal; mso-layout-grid-align: none; mso-background-: background2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Access.Dao.&lt;SPAN style="COLOR: #2b91af"&gt;Field2&lt;/SPAN&gt;)rstChild.Fields[&lt;SPAN style="COLOR: #a31515"&gt;"FileData"&lt;/SPAN&gt;]; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;fldChild.LoadFromFile(tempBook.coverImageURL); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;rstChild.Update(1, &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BACKGROUND: #eeece1; MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-background: background2; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;FormRS.Update(1, &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Of course, everything you just spent 20 minutes reading about happens in less than the blink of an eye, and your when you update your Form’s recordset, the form will have all the data collected from the Web Service and you’re done (or at least I am, if you’re really into this kind of thing, you can now click “Save and New” button on your form and do the whole mess all over again).&lt;/P&gt;
&lt;H3&gt;Conclusion&lt;/H3&gt;
&lt;P&gt;Phew, I think that’s about it. Congrats if you actually made it this far. If you skipped ahead to this paragraph, I’m not going to gratify your laziness with some kind of all-summing conclusion. Hopefully, you now understand enough to know how to twist my project to explore your own wildly cool Web Service + Access intentions.&lt;/P&gt;
&lt;P&gt;You can grab the Visual Studio project from here: &lt;A class="" href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip" mce_href="http://clintc.officeisp.net/Blogs/2007/4_AmazonCodeSample/AmazonDemoAddin.zip"&gt;Code Project&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal&gt;It’s important to mention that I can’t take full credit for the generation of this demo.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I leaned heavily on Ken Gatz’s excellent “Managed Add-in in Access 2007” white paper, as well as the debugging and VB skills of my fellow teammates.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;And frankly, the whole thing was Clint’s idea in the first place, so kudos to him as well.&lt;/P&gt;
&lt;P&gt;If you’ve got additional, specific questions, first read Ken Getz’s whitepaper on “&lt;A href="http://msdn2.microsoft.com/en-us/library/aa902693.aspx" mce_href="http://msdn2.microsoft.com/en-&amp;#13;&amp;#10;&amp;#13;&amp;#10;us/library/aa902693.aspx"&gt;Managed Add-in in Access 2007&lt;/A&gt;” because his is a great article. If you have additional questions, feel free to post your questions here on the blog.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1870144" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Developer/default.aspx">Developer</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Access+2007/default.aspx">Access 2007</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Samples/default.aspx">Samples</category></item><item><title>Web service and sample book database that uses Amazon's Web Services</title><link>http://blogs.msdn.com/clintcovington/archive/2007/02/20/web-service-discussion-and-sample-book-database-that-uses-amazon-s-web-services.aspx</link><pubDate>Tue, 20 Feb 2007 22:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1729201</guid><dc:creator>Clint Covington</dc:creator><slash:comments>22</slash:comments><comments>http://blogs.msdn.com/clintcovington/comments/1729201.aspx</comments><wfw:commentRss>http://blogs.msdn.com/clintcovington/commentrss.aspx?PostID=1729201</wfw:commentRss><description>&lt;P&gt;Today’s guest writer is Access Program Manager Ric Lewis. Ric spent the last couple years&amp;nbsp;with the Indigo team and just took an Access PM&amp;nbsp;job. He is&amp;nbsp;looking for some customer feedback on interesting web services scenarios. To start the conversation—he created an interesting and useful sample book database that uses the Amazon web service.&lt;/P&gt;
&lt;P&gt;Clint&lt;/P&gt;
&lt;H3&gt;Media Players&lt;/H3&gt;
&lt;P&gt;For a few years now, there has been a slowly developing convergence of databases and Web Services. Perhaps one of the best examples of this is your standard media player.&lt;/P&gt;
&lt;P&gt;A media player is a specialized case of asset management (with the assets in this case being digital data). Of course, the biggest barrier to tracking assets in a database is manually entering the information. Remember the first time you ripped a CD and had to manually enter all the album and track info? Now we take for granted that when we rip a CD, our media player will call the Gracenote (or some other) CDDB web service and automatically fill in all the information for us.&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; TEXT-ALIGN: center" align=center&gt;&lt;IMG title="CDDB web service request." height=125 alt="CDDB &amp;#13;&amp;#10;&amp;#13;&amp;#10;web service request." src="http://clintc.officeisp.net/Blogs/2007/2_WebServices/_WS-CDDB.jpg" width=252 mce_src="http://clintc.officeisp.net/Blogs/2007/2_WebServices/_WS-CDDB.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Nowadays, most media players will even go the extra mile of calling Amazon or Wal-mart to grab a high quality cover-art pic.&lt;/P&gt;
&lt;P&gt;A media player is a great example of a widely used database-as-asset manager. And without you really noticing it, over the last few years, between calls to CDDBs and online-music stores, your media player has increasingly become a web application.&lt;/P&gt;
&lt;H3&gt;Databases and Web Services&lt;/H3&gt;
&lt;P&gt;&lt;B&gt;Web services&lt;/B&gt; are all about distributing information, and &lt;B&gt;databases&lt;/B&gt; are all about organizing and visualizing that data. Internally, we talk about Access databases being a landing pad for data. &lt;/SPAN&gt;Using ODBC Access databases connect in rich ways to a number of different data sources. &lt;/P&gt;
&lt;H3&gt;Access 2007 Sample Books Database&lt;/H3&gt;
&lt;P&gt;Until then, I’ve thrown together a hack-ish example of a book-asset management system in Access 2007 which calls through the Amazon web service to collect book information when you type in an ISBN number.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Books Detail form." height=346 alt="Books Details form." src="http://clintc.officeisp.net/Blogs/2007/2_WebServices/_WS-BookDetails.jpg" width=394&gt;&lt;/P&gt;
&lt;P&gt;Installation instructions:&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;-&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Download the &lt;A href="http://clintc.officeisp.net/Blogs/2007/2_WebServices/AmazonDemoAddinSetup.zip" mce_href="http://clintc.officeisp.net/Blogs/2007/2_WebServices/AmazonDemoAddinSetup.zip"&gt;zip file &lt;/A&gt;file (right click on zip and choose Save Target As).&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;-&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Unzip it.&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;-&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Run setup.exe (install for “Just Me”)&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;-&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Copy the msaccess.exe.config file into \Program Files\Office12&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt 0.75in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;-&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Open the Books.accdb file&lt;/P&gt;
&lt;P&gt;You’ll also want to make sure you’ve got macros fully enabled in Access. Then just hit “New Book” (wait a few seconds if it’s the first time), type in an ISBN (ISBN-10 only, AmazonWS doesn’t like ISBN-13), tab out of the ISBN field, and watch your data get filled in! &lt;/P&gt;
&lt;P&gt;In a later post, I’ll talk a bit more about the behind-the-scenes of how this app was developed, and share out the Visual Studio project for the add-in. Download it, play with it, break it (that shouldn’t be too hard) and let your brain start spinning up about the possibilities.&lt;/P&gt;
&lt;P&gt;The program should “just work” on Vista, but on WinXP you’d certainly need WCF installed, which is included in the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-&amp;#13;&amp;#10;&amp;#13;&amp;#10;4A14-83F5-25634C3BF043&amp;amp;displaylang=en"&gt;.NET 3.0 runtime&lt;/A&gt;. &lt;/P&gt;
&lt;H3&gt;Moving Forward&lt;/H3&gt;
&lt;P&gt;As part of investigating many areas for future work we are researching Web Services. &lt;/SPAN&gt;The best way is to always start with identifying useful customer scenarios. &lt;B&gt;What scenarios would you find interesting connecting to web data?&lt;/B&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1729201" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Developer/default.aspx">Developer</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Access+14/default.aspx">Access 14</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Samples/default.aspx">Samples</category></item><item><title>Interactive chart/form filtering code sample</title><link>http://blogs.msdn.com/clintcovington/archive/2006/12/22/interactive-chart-filtering-code-sample.aspx</link><pubDate>Fri, 22 Dec 2006 16:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1347807</guid><dc:creator>Clint Covington</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/clintcovington/comments/1347807.aspx</comments><wfw:commentRss>http://blogs.msdn.com/clintcovington/commentrss.aspx?PostID=1347807</wfw:commentRss><description>&lt;P&gt;&lt;SPAN&gt;One of the most enjoyable design challenges I have had over the last couple of years was redesigning how users can &lt;/SPAN&gt;&lt;A href="http://blogs.msdn.com/access/archive/2006/05/11/595718.aspx" mce_href="http://blogs.msdn.com/access/archive/2006/05/11/595718.aspx"&gt;&lt;SPAN&gt;filter inside Access&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; and Excel. The new filter dropdown menu and context menus were lots of fun to explore different designs and think creatively about how users interact with data. I wanted to make filtering simple for everyone to use but powerful enough to answer most hard questions. One of my key goals was to build a system where users could create 90% of WHERE clauses without using the query designer. It was really fun to watch users be successful use the features in the usability lab. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Recently, I have been hunting the web and rich applications looking for different ways to visualize and interact with data. I noticed in the &lt;/SPAN&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=2E861E76-5D89-450A-B977-980A9841111E&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=2E861E76-5D89-450A-B977-980A9841111E&amp;amp;displaylang=en"&gt;&lt;SPAN&gt;Microsoft Access 2003 Conversion Toolkit&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; that a chart was used to filter tabular data. I thought it would be interesting to create a view that showed trends and data but yet was also useful. The Sales Pipeline template is an example of an application where trend-lines excite users. With a little code and a chart sub-form you can sprinkle a dab of visualization with a pinch of interactivity. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Opportunities.png" mce_src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Opportunities.png"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;BR&gt;&lt;SPAN&gt;&lt;BR&gt;Clicking on a year, month label, or bar in the chart above will filter the Est Closed Date to the year or month selected. For example if you click on Jun you will see all sales opportunities in the month of June. Clicking on the 2007 label will show all the sales opportunities with an expected closed date in 2007. It is even smart enough to maintain filters on other columns as you filter. for example, if you filter where category = hot and click on the April month you will see all records where category = hot and in the month of April. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can download a working sample of the Sales Pipeline database &lt;/SPAN&gt;&lt;A href="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Sales%20pipeline_chart_filter_demo.zip" mce_href="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Sales%20pipeline_chart_filter_demo.zip"&gt;&lt;SPAN&gt;http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Sales%20pipeline_chart_filter_demo.zip&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using the new split-form you can resize the height of the chart and datasheet with the chart growing or shrinking to fill the view.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Opportunities_resize.png" mce_src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Opportunities_resize.png"&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;SPAN&gt;Add the Chart&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Step 1. Open the Open Opportunities List and select all the controls. Remove them from the stack so that you can size the form window smaller. Move all the controls in the detail section up into a cramp space. Turn on the split form resize bar by selecting the form setting the Split Form Splitter Bar = true.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/1_formSmaller.png" mce_src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/1_formSmaller.png"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Step 2. Create a new chart called Filter Chart Sub-form. I won’t go into the details of polishing the chart and the chart settings. Add the chart to the form covering all the controls in the detail section. I found it useful to select the sub-form and setting Top = 0. Select the sub-form and set the Anchoring property to stretch down and across. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Anchor.jpg" mce_src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/Anchor.jpg"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Step 3. The next step is to make sure the chart is always updated when the user adds, updates, or deletes records. I added three simple embedded macros on the AfterUpdate, AfterInsert, AfterDelConfirm events to refresh the chart.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/refresh_subform_chart_macro.png" mce_src="http://clintc.officeisp.net/Blogs/2006/43%20-%20Chart%20Filtering/refresh_subform_chart_macro.png"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;SPAN&gt;Make the Chart Interactive&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Step 1. Add reference to c:\program files\Microsoft Office\Office12\ offowc.dll. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Step 2. Add the following code to the chart sub form. The code should be fairly straight forward. You use an API call to change the cursor from an arrow to a hand when the user hovers over the bars, month, or year labels. &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;When the user clicks on a bar or label it builds an approriate filter string. The first iteration of the demo removed all filters and applied just the new filter. So if the user had filtered by category and applied a filter to Expected Closed Date they would be viewing all categories again. I fixed this bug using the ClearFilterFromSelectedField runcommand to remove just the current column filter instead of the entire form filter. This is a new command in Access 2007.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;You will need to modify the variables sFilterField and sFilterControl in the BuildSQL function to point to the field name and control name you want to filter in your own app. I haven't tried it but there shouldn't be any reason why this technique doesn't work in report browse as well. If anyone out there wants to modify the buildSQL routine to support filtering on strings--send me the updated sample and I will post it to the community following this blog.&lt;/P&gt;
&lt;P&gt;Anyways, here is the code:&lt;/P&gt;&lt;PRE&gt;Option Explicit

Private Const HandCursor = 32649&amp;amp;
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

Dim WithEvents oChart As ChartSpace

Private Sub Form_Load()
    Set oChart = Me.ChartSpace
End Sub

Private Sub Form_Click()
    Dim sVal As String
    Dim sYear As String
    Dim iSeperator As Integer
    
    Select Case Me.ChartSpace.SelectionType
    Case chSelectionPoint
        sVal = Me.ChartSpace.Selection.GetValue(chDimCategories)
        iSeperator = InStr(1, sVal, "-")  'make sure we only filter for year or month and year
        If iSeperator = 0 Then 'selection is a year
        
            FilterByYear sVal
        ElseIf InStr(iSeperator + 1, sVal, "-") = 0 Then
            'selection is a month and year
            sYear = Trim$(Mid$(sVal, 1, iSeperator - 1))
            sVal = Trim$(Mid$(sVal, iSeperator + 1))
            
            FilterByMonth sYear, sVal
        Else
            Exit Sub 'selection is a day or somthing of a lower level that we don't filter for
        End If
                  
    Case chSelectionCategoryLabel
        'set the source object to the proper form
        sVal = Me.ChartSpace.Selection.Caption
        Select Case Me.ChartSpace.Selection.Level 'check to see what level was selected on the x axis
        Case 0  'year
            FilterByYear sVal
        Case 1  'month
            sYear = Me.ChartSpace.Selection.ParentLabel.Caption
            FilterByMonth sYear, sVal
        Case Else
            Exit Sub 'selection is a day or somthing of a lower level that we don't filter for
        End Select
        
    End Select
End Sub

'filters the db list by month
Private Sub FilterByMonth(sYear As String, sVal As String)
    Me.Parent.Form.Filter = BuildSQL(Trim$(sYear), Trim$(sVal))
    Me.Parent.Form.FilterOn = True
End Sub

'filters the db list by year
Private Sub FilterByYear(sVal As String)
    Me.Parent.Form.Filter = BuildSQL(Trim$(sVal), "")
    If Me.Parent.Form.FilterOn = False Then Me.Parent.Form.FilterOn = True
End Sub

' builds the SQL that will filter the form
Private Function BuildSQL(sYear As String, sMonth As String) As String
    Dim sFilterField As String
    Dim sFilterControl As String
    
    sFilterField = "[Est Closed Date]"
    sFilterControl = "Est Closed Date"

    If sMonth &amp;lt;&amp;gt; "" Then 'passed in year and month
        BuildSQL = "(" &amp;amp; sFilterField &amp;amp; " &amp;gt;= #" &amp;amp; FormatDateTime(sMonth &amp;amp; " - " &amp;amp; sYear) &amp;amp; "#) AND (" &amp;amp; sFilterField &amp;amp; " &amp;lt;= #" &amp;amp; DateAdd("m", 1, FormatDateTime(sMonth &amp;amp; " - " &amp;amp; sYear)) - 1 &amp;amp; "#)"
    Else 'just passed in the year
        BuildSQL = "(" &amp;amp; sFilterField &amp;amp; " &amp;gt;= #1/1/" &amp;amp; sYear &amp;amp; "#) AND (" &amp;amp; sFilterField &amp;amp; " &amp;lt;= #12/31/" &amp;amp; sYear &amp;amp; "#)"
    End If
    
    'Clear the filter from the field the chart is filtered on.
    'If you want to clear the entire filter, just set Me.Parent.Filter = "".
    RemoveFilterFromField Me.Parent, sFilterControl
    
    ' If there is still something left of the filter
    If Me.Parent.Filter &amp;lt;&amp;gt; "" Then
        ' Append
        BuildSQL = BuildSQL &amp;amp; " AND (" &amp;amp; Me.Parent.Filter &amp;amp; ")"
    End If
End Function

Private Sub RemoveFilterFromField(frm As Form, strControlName As String)
    frm.SetFocus
    frm.Controls(strControlName).SetFocus
    
    On Error Resume Next
    DoCmd.RunCommand acCmdRemoveFilterFromCurrentColumn  ' This command is new to Access 2007.
    
    Debug.Assert Err.Number = 0 Or Err.Number = 2046 ' 2046 is thrown when there was no filter on the column
    Err.Clear
End Sub

Private Sub Form_CommandBeforeExecute(ByVal Command As Variant, ByVal Cancel As Object)
    ' Cancel the ability to drill into days and hours.
    If Command = chCommandDrill Then
        Cancel = True
    End If
End Sub

Private Sub oChart_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)
    Select Case TypeName(Me.ChartSpace.RangeFromPoint(x, y))
    Case "ChCategoryLabel", "ChPoint"
        'display hand cursor if pointer is over a label or bar
        SetCursor LoadCursor(0, HandCursor)
    Case Else
        'display the normal cursor
        Screen.MousePointer = 0
    End Select
End Sub
&lt;/PRE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1347807" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Developer/default.aspx">Developer</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Templates/default.aspx">Templates</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Design/default.aspx">Design</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Samples/default.aspx">Samples</category></item><item><title>Design for filter favorites functionality in forms </title><link>http://blogs.msdn.com/clintcovington/archive/2006/12/08/new-filter-favorites-in-templates-coming.aspx</link><pubDate>Sat, 09 Dec 2006 04:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1242859</guid><dc:creator>Clint Covington</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/clintcovington/comments/1242859.aspx</comments><wfw:commentRss>http://blogs.msdn.com/clintcovington/commentrss.aspx?PostID=1242859</wfw:commentRss><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Access 2007 introduces a ton of new filtering tools that make it much easier to cut and slice data in different ways. I’m very happy about the new experience and think developers will spend far less time building filtering functionality because of the built in functionality. However, in all releases there are always one or two features round out the scenario that don’t fit into the milestones. One of the ideas we had planned to implement was the notion of filter favorites for any view. The basic idea is to allow users to save common or complex filters and sorts. Unfortunately, that feature was one of the last cuts we made.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Earlier this summer when I was home on paternity leave I had the chance to play around adding filter favorites to our templates. A key goal for the feature was to make it so simple that most users would be successful using and managing filters/sorts. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;One of the goals of our templates is that they don’t have VBA code. We want them to run in sandbox mode without requiring users to enable code. The new functionality is all written in macros without VBA code.&amp;nbsp; You can download a working sample from &lt;FONT face=Arial&gt;&lt;A href="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_Sample.zip"&gt;http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_Sample.zip&lt;/A&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_Sample.zip" mce_href="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_Sample.zip"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Let me describe how it works. There is a dropdown control in the upper right corner with a command for saving a filter. &lt;/SPAN&gt;&lt;/P&gt;&lt;IMG style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite.png" mce_src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite.png"&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The dropdown control provides users with the ability to clear filters, manage filters, and any saved filters. Selecting Clear Filter will remove the forms filter. Selecting any of the other filters will change the current filter of the document.&lt;/SPAN&gt;&lt;/P&gt;&lt;IMG style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_expanded.png" mce_src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Favorite_expanded.png"&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;It is pretty easy to add new filters to the dropdown. Simply filter the list and click on the Add Filter button. This takes a copy of the current filter and sort and saved it in the Filters table. The user is asked to provide a name and description: &lt;/SPAN&gt;&lt;/P&gt;&lt;IMG id=IMG1 style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Details.png" mce_src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Details.png"&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The Show details &amp;gt;&amp;gt; link shows the actual filter and sort SQL strings. I believe it is important to hide unnecessary complexity but provide intuitive ways for advanced users to find it. Most users simply don't need to see that kind of gunk.&lt;/SPAN&gt;&lt;/P&gt;&lt;IMG style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Details_Expanded.png" mce_src="http://clintc.officeisp.net/Blogs/2006/44%20-%20Filter%20Favorites/Filter_Details_Expanded.png"&gt;&lt;BR&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;If you want to add this functionality to your form it is pretty simple. Import the Filters table, Filters macro, and Filter Details form. Copy and paste the dropdown control and Save Filter button to your form.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;As I was writing this blog post I realized you can't delete filters without going to the table. We will get that fixed before the templates are updated. You will also notice icons an all the form buttons--they make it all look much nicer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;If anyone wants to make filter favorites work in report browse with custom ribbons--send me the code and I will post it. &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Anyone have other suggestions how we can make it better? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1242859" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Developer/default.aspx">Developer</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Templates/default.aspx">Templates</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Access+2007/default.aspx">Access 2007</category><category domain="http://blogs.msdn.com/clintcovington/archive/tags/Samples/default.aspx">Samples</category></item></channel></rss>