Microsoft Office Tutorials and References
In Depth Information
Forms: Inserting a New Table Row
Forms: Inserting a New Table Row
Use this procedure to expand the number of rows provided in a table in a
protected form.
Example file:
Scenario: Forms are often used to create offers, invoices,
and other types of repetitive data entry that are best
organized in a table. Knowing in advance how many rows the
table should have in any particular form document is not
What's more, such forms may need to perform calculations
with the data entered into the form fields. Such calculations
are usually performed with the help of the bookmark names
assigned to the form fields. Since bookmark names must be
unique in a document, this means that each row's form field
name has to be incremented, and the formulas adjusted to
use these names.
As an example, look at the sample table on the following page. When the
document is created, the table consists of three rows: the header row, a single,
empty data row, and the totals row. The right-most column calculates Qty *
Unit price for each row; the last cell in the table totals this column. The Qty
and Unit price fields in each row are named with incrementing numbers:
Qty_1, Qty_2, etc. and each Amount field must reference exactly the field
names in its row: Qty_1*Price_1, Qty_2*Price_2, etc.
The macro takes care not only of inserting the new rows, but also renames the
fields and updates any calculation formulas.
Search JabSto ::

Custom Search