#16
|
||||
|
||||
As asked previously, kindly attach your documents here instead of on a different site.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#17
|
|||
|
|||
|
#18
|
||||
|
||||
Quote:
{={IF{REF Dropdown1}= "Finance" 2 {IF{REF Dropdown1}= "HR" 1 0}}*5} where 5 is whatever you want to multiply the selected item's value by. However, that's really no different than: {IF{REF Dropdown1}= "HR" 5}{IF{REF Dropdown1}= "Finance" 10} I suggest you take a look at my Microsoft Word Field Maths Tutorial, available at: http://windowssecrets.com/forums/sho...Maths-Tutorial and: http://www.gmayor.com/downloads.htm#Third_party
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#19
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
Quote:
When I am in ALT-F9 view and putting in the code/formula it doesn't always "activate". Is there something else I should be doing? When I go back to normal view the formula is sometimes written out as it is rather than being "invisible". Forgive my terminology... I'm still learning to speak code. I'm still struggling the get numbers from a dropdown condition to multiply with a FORMTEXT field number. I've tried various ways explained in the tutorial. Again, I'm sure I'm either doing it wrong or assuming one thing works with another when it doesn't. |
#21
|
||||
|
||||
Have you checked for formfields' 'calculate on exit' property and applied the 'filling in forms' protection? Both are required to automate the calculations.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#22
|
|||
|
|||
Quote:
I tried using the table cell address that contains the output, but I'm guessing that's not an option either. |
#23
|
||||
|
||||
Sure. If the displayed output is 001, 002, etc., and you want to multiply that by something, you could use a field code like:
{={REF Dropdown1}*5 \# 0} Unless your dropdown only ever displays numbers, though, you might want something like: {IF{REF Dropdown1}<> "Select an item" {={REF Dropdown1}*5 \# 0}} where 'Select an item' is the default text' or, if some of the selections might not be numeric: {IF{REF Dropdown1}={=0+{REF Dropdown1} \# 0} {={REF Dropdown1}*5 \# 0}}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#24
|
|||
|
|||
So I abandoned any further attempt to use the displayed output in any calculations.
For Table 9a. The displayed output shows a number in the same cell as the dropdown. I type that number into the ITEM N.E.W. field. The TOTAL N.E.W. field calculates the total (=UXOQTY1 * UXONEW1). This seems to be working. For Table 9b. The displayed output shows a number in the same cell as the dropdown. I type that number into the ITEM N.E.W. field. The TOTAL N.E.W. field calculates the total (=DEMOQTY1 * DEMONEW1). This seems to be working. Each ITEM N.E.W. text field has a run on exit macro which is supposed to give the option to add another table row. Both are standalone tables with no merged cells, so I used the =SUM(ABOVE) to add up the numbers in the cells above it. That seems to be working as long as I don't use merged cells. If I do, it throws everything off. For the table below those two (TOTAL NET EXPLOSIVE WEIGHT CONSUMED) I used the bookmarks for the previous totals to get a "grand total". That isn't working. I would simply add all of the formulas from the individual cells, but that wouldn't work if the ADD ROW option worked unless I added more formulas than I expected to ever need. |
#25
|
||||
|
||||
Try Table 9a in the attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#26
|
|||
|
|||
Question: It looks like you added to the original macro I was using from this example. Why did you need to do that?
It works as far as giving the option to add a row... but the calculations no longer work. On Exit from the field that has the add row function the field in the next cell should calculate the product of QTY and N.E.W. What causes this not to work now? When I copy the new macro code to my form with the calculation properties in the field it no longer gives the option to add a row. Would doing this as a PDF form allow for more options? It's starting to seem like what I want is too much for Word to handle. |
#27
|
||||
|
||||
Quote:
Quote:
Quote:
I doubt it - especially when it comes to adding new material definitions & table rows. This is well within Word's capability.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#28
|
|||
|
|||
Awesome!!! Thank you.
A few more questions.... because I wouldn't be a pain in your butt without more questions (1) Is there a way to reset or clear the fields without going into the forms tools? (2) Is there a way to remove rows once they've been added without unlocking the form and going into the developer tools? (3) Is there a way to make the drops downs hold more than 25 items? |
#29
|
||||
|
||||
Re:
1. You could select a given formfield and delete the contents or reset the dropdown value to the default. Added dropdown items and the 'lbs' fields for them can't be removed this way, though. In any event, if you save the document as a template, only the default setup will appear in any new document. 2. Not without devising some means of adding some 'remove rows' code that you could trigger somehow. 3. No. That said, I've coded the macro attached to the Nomenclature dropdown so that two more items can be added. The alternative would be to re-write the document using content controls.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#30
|
|||
|
|||
Quote:
Not a huge... It's simple enough to do like you said. Quote:
Thanks again!! |
Tags |
calculating values, expanding table, form fields |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
Tables with form fields | step10 | Word | 18 | 11-12-2013 02:27 PM |
Enable editing in expanding fields | marweste | Word | 11 | 10-21-2013 07:41 AM |
How to prevent Tables from expanding | HappyFingers | Word | 1 | 11-29-2010 01:54 PM |
Calculating Form Fields in Microsoft Word | wubba80 | Word | 1 | 06-25-2010 12:42 AM |