Re: Importing data From Word Form to Access



Hi =?Utf-8?B?REdqci4=?=,

> I have neither DAO or ADO. I'd like to think I could figure some of it out on
> the fly though if the code is straight forward enough.
>
IF you have Access, you have DAO and ADO. These are the protocols for working
directly with the datasets; DAO (Data Access Objects) is Access "native" one;
ADO (ActiveX Data Objects) is more generally applicable (replaces ODBC).

> have a form that I'd like to have
> automatically save both the form (as designed), and also push the data to an
> access database.
>
Well, the basic syntax for passing the data is

rs.Fields("name").Value = doc.Formfields("name").Result

But before you can use that, you have to understand how to build a connection
to the table (recordset) in a database, and loop through its contents. You'll
find a sample file - WdAcc97.zip - in the mail merge section of my website that
shows how to transfer data between Access and Word using VBA. It doesn't deal
with forms, but it will show you how to connect to an Access database/table,
create a recordset, loop through it, and pass in data. Once you understand how
that works, you can use the line of code above to make it work with formfields.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

.



Relevant Pages

  • Re: Form data output
    ... > CSV file. ... Access to extract the data from Word or the text file (ADO or DAO ... reply in the newsgroup and not by e-mail :-) ...
    (microsoft.public.word.vba.userforms)
  • Re: VB6 ADO to Access 2.0
    ... >>16-bit version of an Access database. ... > I've trying to educate myself away from DAO onto ADO - been using DAO ... better luck with the Jet 3.5x OLEDB Provider. ...
    (microsoft.public.vb.general.discussion)
  • Re: Create Table Example in asp
    ... of your DAO code to ADO. ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.scripting.vbscript)
  • Re: Fastest record create method with JET 4.0
    ... and so am trying to use the Jet 4.0 engine. ... Basically, all my application does with the Access database is connect, open ... Currently I use ADO to connect to Jet 4.0. ... I can't find any DAO specific discussion group. ...
    (microsoft.public.data.ado)
  • Re: A common problem : ADO vs DAO slower
    ... Dave Patrick ....Please no email replies - reply in newsgroup. ... | we have migrated our application that uses an MS Access database from DAO ... | Now we encounter the most common problem: ADO is slower than DAO. ...
    (microsoft.public.data.ado)