Site Meter Microsoft Office » Blog Archive » Automate data collection forms using VBA

Automate data collection forms using VBA

by

Access

Access

From Access team blog: Access 2007 has a nifty feature that allows you to collect data via email. Recently, I got the following question from a user:

Is there any way to automate the creation, sending and receiving of Emails through the Data Collection capability of A07 using VBA? The wizard is too complex for the users I am working with.

Here is the reply we got from the developer—it isn’t for the faint at heart…

There isn’t a straight-forward way to do this and it isn’t officially supported. It’s possible if you don’t mind a little reverse engineering… The key is that there are two places Data Collection uses to do its work. One is in a system table inside Access used to store information about the action, and the other is an XML file that Outlook uses when mails are received to identify Data Collection mails and associated databases.

The system table is called MSysDataCollection. There’s one entry for each data collection action that’s created in the database. A quick rundown of the fields:

Active – Controls whether the current Data Collection action should be run.
BasedOnType – This marks whether the data collection is based on a query or a table
CreatedDate – When was the data collection action originally started.
ExternalID – A unique GUID to identify the Data Collection action
FormName – Name of the form; appears in the e-mail subject
InfoPathForm – True if we sent out an InfoPath form, false if it was HTML
Mapping – An XML chunk that defines how fields in the table/query map to fields in the form. Your best bet is to create a few Data Collection actions similar to ones your users might create, and mimic the XML. Here’s some of the interesting bits

stores most of the properties found in the Options dialog of the Data Collection Wizard

, despite the name, only supports one table. This section stores the database column name to the form field name mapping.

’s name attribute should always be “table1”, accessTable is the table name inside Access, and collectionType is either “insert” or “update”
points to where in the InfoPath/HTML form we’re looking for data (as opposed to formatting, etc.). This doesn’t change much.
There will be one
for each column in your form, including hidden fields. formNode is for the form, and is always “table1fieldX”, tableCell is for the Access table
The tag stores who we sent the mail to, in case we want to only accept certain people’s responses, or limit how many times, or what rows, they can update.

Read more by clicking link above.


Leave a Reply


About Microsoft Office

We’ll be discussing Microsoft Office products, the suites, updates and upgrades, tips and tricks. There are wonderful programs that Microsoft has come out with, especially Word, Excel and Outlook. There are programs for everyone out there, from home and student workers, small businesses and corporations. So, keep in contact, watch this space, as the saying goes, contact me with your tips, comments

Microsoft Office Author(s)

Technology Channel Posts

  • Cell Phones + Social Networks = Love?
    [caption id="attachment_262" align="alignnone" width="128" caption="Social Networks"][/caption]Wireless industry ready to interface with Facebook, MySpace and Bebo Everybody at this week's Mobile [...]
  • LG X120 Netbook
    LG Electronics has announced it is launching their newest netbook called the LG X120. The laptop is a cute one with only 10.1″ screen with backlit. Powering it is an Intel Atom processor [...]
  • Uniea Haptique HardShell Case for MacBook
    This hardshell cases for the new MacBook aluminum are made of ABS plastic coupled with soft touch coating. It offers a textured feel, almost leather like, and protects the surface of the laptop [...]
  • Haier shows off it's offerings to the masses
    [caption id="attachment_1757" align="alignnone" width="600" caption="Haier netb ook, G1 and G2"][/caption]The fine folks over at Haier shows off mysterious "NetBooks," Android phones Haier's [...]
  • Hackers target Gamers
    [caption id="attachment_887" align="alignnone" width="128" caption="Xbox"][/caption]Although I'm not a gamer, everyone should be aware of hackers and malware. According to microsoft, What's the [...]
  • Microsoft Equips Individuals With New Training Resources Needed for Jobs
    [caption id="attachment_733" align="alignnone" width="109" caption="Microsoft"][/caption]Second time around for this bit of news, but very apropos in today's business climate. Microsoft Corp. [...]
  • LG Phone's Transparent Keypad Expected to "Make A New Fashion Statement"
    [caption id="attachment_259" align="alignnone" width="950" caption="Transluscent Phone"][/caption][caption id="attachment_258" align="alignnone" width="500" caption="LG GD-900"][/caption]Firmware or [...]
  • Preorder Nokia N86 at Expansys
    [caption id="attachment_1754" align="alignnone" width="162" caption="Nokia N86"][/caption]Engadget breaks this story: European markets can expect to see Nokia's N86 handset on or about July 22, [...]
  • Microsoft Tests Vista SP2, Readies Windows 7 Updates
    [caption id="attachment_884" align="alignnone" width="116" caption="Vista"][/caption]Lots coming out of Redmond these days. Service Pack 2 for Windows Vista and Windows Server 2008 is reportedly [...]
  • Five Steps to an E-friendly Résumé
    [caption id="attachment_730" align="alignnone" width="128" caption="Resume on Outlook"][/caption]With today's economy and layoffs, we all need all the help we can get when searching for jobs. MSN [...]

Hot Off The Press