Re: WORD TABLE FORMULAS Forms

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Doug Robbins (dkr_at_NOmvpsSPAM.org)
Date: 10/27/04


Date: Tue, 26 Oct 2004 20:28:01 -0400

Are these FormField type checkboxes?

If so, I would put another text formfield in Cell A2 of table E and use the
following code in macros that run on exit from each of the checkboxes, that
are assumed to have the bookmark name of Check1 and Check2, while the text
formfield is assumed to have the name of Text1

On exit from Check1, use:

If ActiveDocument.Formfields("Check1").Checkbox.Value = True then
    ActiveDocument.Formfields("Check2").CheckBox.Value = False
    ActiveDocument.Formfields("Text1").Result = "$59.99"
Else
    ActiveDocument.Formfields("Check2").CheckBox.Value = True
    ActiveDocument.Formfields("Text1").Result = "$100.00"
End if

On exit from Check2, use:

If ActiveDocument.Formfields("Check2").Checkbox.Value = True then
    ActiveDocument.Formfields("Check1").CheckBox.Value = False
    ActiveDocument.Formfields("Text1").Result = "$100.00"
Else
    ActiveDocument.Formfields("Check1").CheckBox.Value = True
    ActiveDocument.Formfields("Text1").Result = "$59.99"
End if

-- 
Please respond to the Newsgroup for the benefit of others who may be 
interested.   Questions sent directly to me will only be answered on a paid 
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
"BigWylie1" <BigWylie1@discussions.microsoft.com> wrote in message 
news:5D89B8FE-01BA-4C92-BACE-01FD89D51A0B@microsoft.com...
>I have created a form with multiple tables.
> In table "C", the user has the option to select check box "option 1" for
> $59.99 or Check box 'option 2' for $100.
>
> In Table "e" I want to create a formula, ( I think it will be an IF/Then,)
> which will read which option (1 OR 2, but not both) has been selected in
> table 'C' and return either a '$59.99' value or a '$100.00' value in Table
> E-Cell A2 depending on which check box was selected.
>
> I hope I have been clear.  I also hope that Table 'C' does not have to be
> connected to table 'E' in order to pull a reference from table 'C'.
>
> Can anybody help???
> Thank you. 


Relevant Pages

  • Re: Unprotect and Protect template when user enters a Formfield
    ... I know the Exit Macro doesn't work. ... the formfield description so the template is protected again. ... "Charles Kenyon" schreef: ... when he goes to the next formfield the protection should be ...
    (microsoft.public.word.vba.general)
  • Re: Preventing document from closing if field left blank
    ... (ie a user not being able to exit a document) ... if a specific formfield within ... Public Sub AutoClose() ... ' Dismiss the displayed prompt. ...
    (microsoft.public.word.vba.general)
  • Re: Insert New Row w/ Form Fields
    ... Have the following macro run on exit from the last formfield in the last row ... ' Macro created 02/02/03 by Doug Robbins ... Dim rownum As Integer, i As Integer ...
    (microsoft.public.word.vba.general)
  • Re: Saving form file named by a field
    ... Run the following code on exit from the formfield that contains the name ... With ActiveDocument ... macro using bookmark and copying it and pasting it to the file name box. ...
    (microsoft.public.word.vba.general)
  • Re: Forms and tables
    ... Have the following macro run on exit from the last formfield in the table: ... Sub addrow() ... ' Macro created 02/02/03 by Doug Robbins ...
    (microsoft.public.word.tables)