|
|
Thread Tools | Display Modes |
#16
|
||||
|
||||
It's all in the macro code. Open the document and press Alt-F11 to access the VBA Editor. There you'll see: Code:
Case 2 'The 1st row of formfields Select Case c 'The columns of formfields Case 2: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 9000 Case 4: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 4500 Case 6: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 6000 Case 8: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 3000 End Select Case 3 'The 2nd row of formfields Select Case c 'The columns of formfields Case 2: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 8000 Case 4: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 6000 Case 6: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 4000 Case 8: If .Range.FormFields(1).CheckBox.Value = True Then i = i + 2000
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#17
|
|||
|
|||
Apologies my confusion came as the numbers originally represented by the check boxes were different to what I could see on the code, I've adjusted the values and it works great now, thank you!
However, one of the calculations at the bottom of the page doesnt seem to be working correctly, How can I edit this as I see nothing for this on the code? Below is an example: the last calculation where subtracting from €100,000, the number subtracted is random and not what has been assigned to any of the boxes. Quote:
|
#18
|
||||
|
||||
My understanding from what you'd previously said was that the amount to deduct from €100,000 is only half what you'd deduct from €200,000. Is that not so?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#19
|
|||
|
|||
No the amount to be deducted from the €100,000 is the total sum of the services selected which is the same as the the amount deducted from €200,000 not half. Apologies for causing this confusion.
How can I edit this on the form? |
#20
|
||||
|
||||
In that case, open the document and unprotect it (Developer|Restrict Editing>Stop Protection). Select the problem field and press Shift-F9. You should see {=100000-{DOCPROPERTY Value }/2 \# ",0"}. Simply delete the '/2', then re-apply the protection (add a password if you want one).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#21
|
|||
|
|||
PERFECT!!!! thank you very much for you help!!!! Excellent solutions, care and explanations, couldn't have done it without your help, thanks for helping the community!!!!
|
#22
|
|||
|
|||
just one question, If i replaced the content control check boxes for formfield check boxes, would i be able to add a formula (containing the same conditions as those for the content control check boxes) into the formfield check boxes and get rid of the macro from the document? and will the document work correctly without the macro?
|
#23
|
||||
|
||||
The document contains only formfields, including the checkboxes (i.e. no content control checkboxes), so there's nothing to change on that front. And, as I said in post #4:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#24
|
|||
|
|||
PERFECTO!!! thanks so much for your help. I can now re work and learn from what youve shown me here
|
#25
|
||||
|
||||
To see how it's done, unprotect the document, select the entire empty paragraph immediately after the table and press Shift-F9.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
addition, assign values, subtracting |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assigning values to form fields and calculating results | AustralianKate | Word Tables | 10 | 05-15-2018 10:53 PM |
Can I add part of a paragraph to the document map? | Jennifer Murphy | Word | 1 | 05-28-2017 11:23 PM |
Assigning values to formfield checkboxes in a table | mammiano | Word Tables | 13 | 01-12-2015 06:27 AM |
Set style for part of paragraph | meileetan | Word | 7 | 06-07-2013 01:09 AM |
Assigning Values to content control checkboxes and calculating results | creative cathy | Word Tables | 13 | 10-07-2012 08:52 PM |