Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Bert0529 Bert0529 is offline
external usenet poster
 
Posts: 1
Default Tables and Formulas in Forms

Hello All,

I am creating a commercial invoice form and in that form I have a table with
the following fields:

Item Number, Quantity, Unit, Description, Unit Price, Total Price

The way I'd like the form to work is that the user can enter information
under the various headings for as many Items as there are using one row for
each item. In other words a row would be added when needed for each new line
item and the calculations would be performed automatically (including the
totalling the the Total Price column). Any suggestions for how to accomplish
this?

In my tinkering I once came across a means of entering data into the fields
of the table by a means that used a yellow-ish shaded text area. I cannot
seem to refind that function. If this sounds familiar please tell me the name
of this feature.

Thank you,

Bert


  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Tables and Formulas in Forms

You could use a modification of the following code to accomplish what you
are after. It will however take a bit more code than is provided he

' Macro created 02/02/03 by Doug Robbins

' To add a new row to a table containing formfields in every column

' automatically on exit from the last cell in the present last row of the
table

Dim rownum As Integer, i As Integer

ActiveDocument.Unprotect

ActiveDocument.Tables(1).Rows.Add

rownum = ActiveDocument.Tables(1).Rows.Count

For i = 1 To ActiveDocument.Tables(1).Columns.Count

ActiveDocument.FormFields.Add
Range:=ActiveDocument.Tables(1).Cell(rownum, i).Range,
Type:=wdFieldFormTextInput

Next i

ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).ExitMacro =
"addrow"

ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
1).Range.FormFields(1).Select

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True


--
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

"Bert0529" wrote in message
...
Hello All,

I am creating a commercial invoice form and in that form I have a table
with
the following fields:

Item Number, Quantity, Unit, Description, Unit Price, Total Price

The way I'd like the form to work is that the user can enter information
under the various headings for as many Items as there are using one row
for
each item. In other words a row would be added when needed for each new
line
item and the calculations would be performed automatically (including the
totalling the the Total Price column). Any suggestions for how to
accomplish
this?

In my tinkering I once came across a means of entering data into the
fields
of the table by a means that used a yellow-ish shaded text area. I cannot
seem to refind that function. If this sounds familiar please tell me the
name
of this feature.

Thank you,

Bert




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I SUM/ADD Formulas and Form Texts in Word Tables? Stacey Tables 1 May 20th 06 02:00 AM
FORMULAS IN TABLES STOBBSNET1 New Users 6 February 27th 06 09:30 PM
Working with formulas in Word tables - calculating time on scene. HCFRAdmin Tables 6 January 21st 06 05:28 AM
Help - creating forms and formulas in Word Cindy Meister Microsoft Word Help 0 August 10th 05 02:08 PM
Help - creating forms and formulas in Word Cindy Meister Mailmerge 0 August 10th 05 02:08 PM


All times are GMT +1. The time now is 02:04 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"