The Get Data From Word Database demonstrates gathering data from TextBoxes and a ComboBox in a Word Document into an Access Table. 

NAMING AND ADDING TEXTBOXES, COMBOBOXES, AND CHECKBOXES:
To add and name TextBoxes in Word you need to use the Control ToolBox. You can make it visible by clicking on the Menu Bar: View > Toolbars > Control ToolBox.

The first thing you need to do with it is to open Design Mode by clicking on the triangle-shaped icon on the Toolbox. Next, right-click on a TextBox and select "Properties".  The Properties Dialog Box will appear.  It has two columns.  The column on the left is the Property Name and the right column is the Property Value.  Find the "(Name)" Property. You can change the name in the right column.

This next part is important.  You have to name your controls in a certain way so the code will work.  The names have two parts.  A 3 letter prefix and the name of the Field in your Database.  I have set up the code to work with TextBoxes, ComboBoxes, and CheckBoxes that have a "Naming Convention" prefix that is 3 letters long.  You can use whatever prefix you want.  I have used txt with TextBoxes and cbo with the ComboBox.  The code matches the part of the textbox name *after* the prefix to your Database Field Name and loads the TextBox or ComboBox value into that Database Field.  So the code recognizes that the "txtFirstName" Textbox value should be added to your "FirstName" Field.

To add a TextBox, etc. to your Document place your cursor in the document where you want the TextBox, and click on the TextBox Icon on the Control ToolBox. Your TextBox should be added there.

I added a ComboBox to the Access Form so you can select a Table.  I added a Custom Form Property so that the last Table you selected will allways appear in the ComboBox.  This is so you do not have to select the same Table every time you open the database.  So you should not have to write any code or change anything in your Database to use it.

To protect your Document, Click View > Toolbars > Forms.  Then click on the lock to lock the document. Now all the users can do is use the TextBoxes and ComboBoxes and they can tab through them. You do not have to set the tab order and they can't change the text on your document.  A great way to preserve the original while keeping your document handy is to save it as a Template.

To use this in your Database import *everything* into your Database, all Forms, Tables, Queries, and Modules from the DataFromWord Database except for CommandBars. 

If you need any help or have questions contact me at contact@gainingaccess.net

Best Regards,
Pat Wood
http://gainingaccess.net

