By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

Saving text fields from Word templates into Access DB?

P: n/a
We have an access DB that 2 input people use to tracking incoming
patients. There is a form for them to do this but they find it
confusing to use (it's plainly laid out, no one else complains about
it). Management has decided that they want me to link 15 of our
templates so when a template is opened and text entered into one of the
text fields it will automatically be entered into the database.

First of all, is this possible?

Secondly, how would I do this? A link or book reference is good if
you're not up to explaining it. :)

Any help is appreciated.

May 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> We have an access DB that 2 input people use to tracking incoming
patients. There is a form for them to do this but they find it
confusing to use (it's plainly laid out, no one else complains about
it).
....You mean 2 forms in Access, right? Or forms in Word?
Management has decided that they want me to link 15 of our
templates so when a template is opened and text entered into one of the
text fields it will automatically be entered into the database.

First of all, is this possible?
Template - as in Word Template, right? I think it is possible using
VBA.
http://forums.microsoft.com/MSDN/Sho...69217&SiteID=1
example describes a little bit. The bottom line is - if you get to read
the entry fields in your Word document using VBA, the rest is pretty
simple. Remember, you will have to add a reference to Microsoft Active
X Data Objects 2/2.1/2.5 or other to connect to your Access Database.
Secondly, how would I do this? A link or book reference is good if
you're not up to explaining it. :)

Any help is appreciated.


Lets say your Word document has a form text field that you name it
Text1, in your Document_Close() event, you will write something like
this to access the value in the text box:
MsgBox Me.FormFields.Item("Text1").Result

Using this concept, you could create a user-form to save data to Access
database.

Steps involved would be:
* try to create a simple macro or user form that will react to user's
need
* write code with actions (like clicking of a user-form's button, or
closing of the document) that will read information from the Word
document's form text field
* take this information and validate information, if everything is as
desired, open a connection to Access and insert the information in
table(s)
* Close the connection and finish the action the user invoked. Make
sure there is a graceful exit (probably logs created) if the
code/macro/module is written for Document_Close() event

Hope this helps.

Chirag Shukla.

May 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.