Can Form Field text be exported from Word?

B

Brad Moss

I have a Word document with form fields. I will have users enter text into
the form fields. I would then like to export the data from the form fields
into a database. And, it is important that I have some way of tagging each
bit of data entered to a item number listed on the page the data was entered
into. I am sure there is a way to do this, yet can't figure out exactly how
to pull it off. Any help or comments offered would be appreciated.

Take care,
Brad
 
D

Doug Robbins - Word MVP

You will find the basics in the last of the following series of articles:

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

alborg

Hi Brad:

What you need to do is to use UserForms where the data is uploaded to
UserForm fields, then you use DAO to transfer the data onto a backend
database.

For example, in a UserForm_Initialize() event you might have something like
this to bring up a date from an ActiveForm's date field:

[schDate] = ActiveDocument.Tables(3).Cell(myRow,
ActiveDocument.Tables(3).Columns.Count - 1).Range.FormFields(1).Result

After you pull up all the information, you can do this to send the
information to the underlying table:

Set db = OpenDatabase(conDBpath2)
Set rs = db.OpenRecordset("SELECT Demographics.* FROM Demographics;",
dbOpenDynaset)
With rs
.MoveLast
.AddNew
![Last] = IIf(IsNull([LNAME]) Or Len([LNAME]) = 0, ".", [LNAME])
![First] = IIf(IsNull([FNAME]) Or Len([FNAME]) = 0, ".", [FNAME])
![ChartID] = IIf(IsNull([ACCT]), 0, [ACCT])
![BirthDate] = IIf(IsNull([DOB]) Or Len([DOB]) = 0, #1/1/1911#,
[DOB])
.Update
.Close
db.Close
End With

That's all there is to it.

Cheers,
Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top