#1
|
|||
|
|||
Form auto fill based on a different field value.
Greetings!
I am trying to generate a form with multiple fields - with each field having different set of look up values. I was trying to check, if it is possible to pre-populate field values, based on the value selected in the first field drop down. For example: if Dept = HR, then following field values should be prepopulated Code = 001, Location = Atlanta if Dept = Finance, then Code = 002, Location = Chicago Lookup Values of Dept, Code and Locations will be predefined. Please advise. Thanks in advance... |
#2
|
||||
|
||||
Hi stct,
See attached. The document uses a dropdown formfield for the predefined values, and formula fields for the variable output. If you unprotect the document and press Alt-F9, you'll be able to see the formula field contents. Note that you must exit the formfield (via the TAB key) after updating it for the conditional output to appear.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi Macropod,
Thank you for the prompt response. I think, the requirements are the same as depicted by you. Unfortunately, I am unable to see the dynamic value changing into Code and Location field, after changing the value in Dept (Dropdown1) field. Any advise if I need to configure the word document setup? I do see the IF statement correctly. Just that, it is not populating with the values after protecting the document. Please advise. Thank you! |
#4
|
||||
|
||||
Hi stct,
Did you exit the formfield (via the TAB key) after updating it?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Yes, I think, I clicked on the blank space outside the form field areas to exit. Unfortunately, it did not execute the script due to some reason.
Please advise. Should I click anywhere else in the secondary field area? |
#6
|
||||
|
||||
After updating the dropdown, press the TAB key (with only one formfield, you can't actually click on anything else).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Thank you Paul! This is perfect. I was wrongly clicking mouse somewhere in the white space instead of pressing TAB key.. With the TAB key, it worked exactly to what we were looking for...
|
#8
|
|||
|
|||
So I am attempting to duplicate this and I'm stuck.
APP1Supply = {IF{REF EngineType } = “CM2350” “J2-09”}{IF{REF EngineType }= “CM2150” “J2-27”} This is what I have referencing a dropdown box called "EngineType" with the choices CM2350 and CM2150. Trying to populate fields with either J2-09 or J2-27. When I protect the document the above "code" stays. I thing I need one more step in the instruction. Thanks! |
#9
|
||||
|
||||
That suggests either:
a) you have Word's field code display toggled 'on'; or b) you have typed the field braces (i.e. { }). For: a) try pressing Alt-F9 to toggle the field code display; and b) the field brace pairs (i.e. '{ }') are created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Thanks!
I was able to get this to work perfectly. I need one more step. After the user chooses "EngineType" and the circuit connections "J2-09" are populated. Is it possible to bookmark these choices and use them throughout. The test procedure will ask the user to, "Open the circuit J2-09, Accelerator Pedal Position 1 Supply of the tester." and so on throughout. Is this even possible? If so would you mind showing/explaining an example?
Thanks! “The only man who never makes mistakes is the man who never does anything." -Theodore Roosevelt |
#11
|
||||
|
||||
There's numerous ways of doing this, including:
1. nest your existing fields thus: {IF{REF EngineType}= "CM2350" "J2-09" {IF{REF EngineType}= "CM2150" "J2-27"}} and bookmark them as a group. You can then insert cross-references to the bookmark wherever you like; 2. embed your existing fields in a QUOTE field, thus: {QUOTE{IF{REF EngineType}= "CM2350" "J2-09" {IF{REF EngineType}= "CM2150" "J2-27"}}} and bookmark it. You can then insert cross-references to the bookmark wherever you like; 3. embed your existing fields in a SET field, thus: {SET EngineREF {IF{REF EngineType}= "CM2350" "J2-09" {IF{REF EngineType}= "CM2150" "J2-27"}}} then insert cross-references to the EngineREF bookmark wherever you like; and 4. Simply repeat the existing fields wherever you want the output replicated.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
Extremely helpful, Thanks!
|
#13
|
|||
|
|||
Hi Paul,
This is what I have. Product ID: {FORMDROPDOWN} containing: Blank space, BDR and BDO. C_EPD_Overspeed_Limit = {IF{REF ProductID}="BDR""2600 rpm"} C_EPD_Overspeed_Error_Reset = {IF{REF ProductID}="BDR""2600 rpm"} C_EPD_Overspeed_Allowed_Time = {IF{REF ProductID}="BDR""2600 rpm"} C_EPS_n_ASICOverspeedLimit = {IF{REF ProductID}="BDR""2600 rpm"} C_EPS_n_ASICOverspeedReset = {IF{REF ProductID}="BDR""2600 rpm"} T_DIP_Key_Switch_RLOC = {IF{REF ProductID}="BDR""2600 rpm"} I bookmarked each of these: C_EPD_Overspeed_Limit, C_EPD_Overspeed_Error_Reset, etc..... Using the open loop engine speed control feature of the tester, set the engine speed such that _Engine_Speed = _____________ Here is where I want to add +10 and later on in the document I would like to -10, I also need it to clear. How would I go about this? If this belongs somewhere else please excuse me and point me in the direction..... Thanks! Last edited by regwitt; 09-16-2014 at 12:32 PM. |
#14
|
||||
|
||||
Given that all the fields are the same, why not just bookmark the first one, then insert cross-references to that one bookmark? You certainly don't need to bookmark every field. Indeed, you don't need to bookmark any of them if all you're going to do is replicate the formula field wherever you want the output repeated.
Now, suppose you bookmark just the first instance, with 'RPM' as the bookmark name. In that case, wherever you want the same results to appear, simply insert a cross-reference to the RPM bookmark. Done. To output the RPM +/- 10, simply use another formula field, coded as: {=RPM+10} or: {=RPM-10}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
Hi Paul,
I must apologize. My previous post was wrong. I tried to quickly get it submitted before I left for the day, copied and pasted forgetting to make the necessary changes. This is what I have. Product ID: {FORMDROPDOWN} containing: Blank space, BDR, BDO, etc. Roughly 25 different engine types. C_EPD_Overspeed_Limit = {IF{REF ProductID}="BDR""2650 rpm"} C_EPD_Overspeed_Error_Reset = {IF{REF ProductID}="BDR""2300 rpm"} C_EPD_Overspeed_Allowed_Time = {IF{REF ProductID}="BDR""0.26 s"} C_EPS_n_ASICOverspeedLimit = {IF{REF ProductID}="BDR""2750 rpm"} C_EPS_n_ASICOverspeedReset = {IF{REF ProductID}="BDR""2290 rpm"} T_DIP_Key_Switch_RLOC = {IF{REF ProductID}="BDR""240"} I bookmarked each of these: C_EPD_Overspeed_Limit, C_EPD_Overspeed_Error_Reset, etc..... Using the open loop engine speed control feature of the tester, set the engine speed such that _Engine_Speed = _____________. I will need to change the time and change the rpm values according to the feature being tested within each separate engine type, so the math will change through out the procedure. Here is where I want to add +10 and later on in the document I would like to -10, I also need it to clear. How would I go about this? Thanks! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MACRO - Insert row based on Form Field Criteria | Elan05 | Word VBA | 5 | 04-16-2013 06:39 AM |
Nested if field that contains a fill-in field is not prompting for fill-in info | Nccadm | Mail Merge | 2 | 04-02-2013 03:15 AM |
Form file timesheet, auto fill date from calander | jkeeney | Word | 1 | 03-21-2012 12:21 AM |
Macro to populate a text form field based on dropdown selection | koloa | Word | 0 | 10-20-2011 11:52 AM |
How can I fill in form I received in email that used underlines instead of text field | Gail L. | Word | 2 | 05-17-2009 12:38 PM |