Reply
 
Thread Tools Display Modes
  #1   Report Post  
BigWylie1
 
Posts: n/a
Default WORD TABLE FORMULAS Forms

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.
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

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" wrote in message
...
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.



  #3   Report Post  
BigWylie1
 
Posts: n/a
Default

Sorry this is not clear enough.
I tried to duplicate the MAcro but when I complete this I can no longer
protect the entire document as a Form. That is the purpose of this form?

why have you included "activeDocument.formfields" before the brackets? is
this required?and why "checkbox.value" after the Bookmark references?

Should the formula in the TEXT1 CELL( I bookmarked it 'Subtotal') look like
this:

IF CHECK1=True then
CHECK2=false
TEXT1="$59.99"
ELSE
CHECK2=True then
TEXT1="$100.00"
End IF



"Doug Robbins" wrote:

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" wrote in message
...
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.




  #4   Report Post  
Doug Robbins
 
Posts: n/a
Default

There is nothing in the macro that will prevent you from protecting the
document for forms.

The code is written the way that it is because that is the required syntax.

I had not tried it when I posted it, but I have now and it does work.

See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at:

http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm


--
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" wrote in message
...
Sorry this is not clear enough.
I tried to duplicate the MAcro but when I complete this I can no longer
protect the entire document as a Form. That is the purpose of this form?

why have you included "activeDocument.formfields" before the brackets? is
this required?and why "checkbox.value" after the Bookmark references?

Should the formula in the TEXT1 CELL( I bookmarked it 'Subtotal') look
like
this:

IF CHECK1=True then
CHECK2=false
TEXT1="$59.99"
ELSE
CHECK2=True then
TEXT1="$100.00"
End IF



"Doug Robbins" wrote:

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" wrote in message
...
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.






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 can I divide a page into three sections? Bonnie Microsoft Word Help 3 May 8th 23 02:47 AM
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 11:50 PM
WordPerfect - copying formatting Morgan Page Layout 1 January 10th 05 06:00 PM
Continuous breaks convert to next page breaks Jennifer Hunt Microsoft Word Help 2 December 30th 04 06:45 PM
macro in word js Microsoft Word Help 1 December 28th 04 04:01 AM


All times are GMT +1. The time now is 02:11 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"