Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
I have a dropdown and textbox fields in my document. When an item is
selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi Francis,
Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Yes and no. You can colour conditional fields based on the result of a
dropdown, but not text form fields, for which you would need vba (see http://www.gmayor.com/word_vba_examples.htm ) In the following example, colour the three conditional fields as required and set the calculate on exit check box of the dropdown field. { IF { Dropdown1 } = "Apple" "This text is green" \*charformat }{ IF { Dropdown1 } = "Strawberry" "This text is red" \*charformat }{ IF { Dropdown1 } = "Blueberry" "This text is blue" \*charformat } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi,
Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Did you use CTRL+F9 for each pair of brackets?
Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
I think he wants the words "red" and "green" rather than coloring the
type. On Sep 4, 12:32*am, "Graham Mayor" wrote: Yes and no. You can colour conditional fields based on the result of a dropdown, but not text form fields, for which you would need vba (seehttp://www.gmayor.com/word_vba_examples.htm) In the following example, colour the three conditional fields as required and set the calculate on exit check box of the dropdown field. { IF { Dropdown1 } = "Apple" "This text is green" \*charformat }{ IF { Dropdown1 } = "Strawberry" "This text is red" \*charformat }{ IF { Dropdown1 } = "Blueberry" "This text is blue" \*charformat } -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Francis Ang wrote: I have a dropdown and textbox fields in my document. * When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. *Can this be achieved without using VBA? Any help is very much appreciated. Thank you.- |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
In that case change the result texts and don't bother colouring the fields.
The principle remains the same. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: I think he wants the words "red" and "green" rather than coloring the type. On Sep 4, 12:32 am, "Graham Mayor" wrote: Yes and no. You can colour conditional fields based on the result of a dropdown, but not text form fields, for which you would need vba (seehttp://www.gmayor.com/word_vba_examples.htm) In the following example, colour the three conditional fields as required and set the calculate on exit check box of the dropdown field. { IF { Dropdown1 } = "Apple" "This text is green" \*charformat }{ IF { Dropdown1 } = "Strawberry" "This text is red" \*charformat }{ IF { Dropdown1 } = "Blueberry" "This text is blue" \*charformat } -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Francis Ang wrote: I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you.- |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi,
I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi Francis,
The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been coded for, nothing will show. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi,
I am new at this. What do you mean the dropdown option has to be coded? The {} were created using Ctrl+F9. The dropdown option 'calculate on exit' has been set. Dropdown option is Bookmarked as Dropdown1 What else do I have to do? "macropod" wrote: Hi Francis, The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been coded for, nothing will show. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#11
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Hi Francis,
OK, so provided the Dropdown has the Apple" and "Strawberry" options, all you need to do is to protect the document for forms and select one of those options from the Dropdown. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I am new at this. What do you mean the dropdown option has to be coded? The {} were created using Ctrl+F9. The dropdown option 'calculate on exit' has been set. Dropdown option is Bookmarked as Dropdown1 What else do I have to do? "macropod" wrote: Hi Francis, The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been coded for, nothing will show. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#12
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Then TAB out of the dropdown field to activate the update.
Note that this will not work if the conditional field is in the page header/footer. For that you would need a macro to update the field. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Francis, OK, so provided the Dropdown has the Apple" and "Strawberry" options, all you need to do is to protect the document for forms and select one of those options from the Dropdown. "Francis Ang" wrote in message ... Hi, I am new at this. What do you mean the dropdown option has to be coded? The {} were created using Ctrl+F9. The dropdown option 'calculate on exit' has been set. Dropdown option is Bookmarked as Dropdown1 What else do I have to do? "macropod" wrote: Hi Francis, The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been coded for, nothing will show. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
#13
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Dropdown Field
Thanks to Macropod, Graham and Peter for all your assistance.
"Graham Mayor" wrote: Then TAB out of the dropdown field to activate the update. Note that this will not work if the conditional field is in the page header/footer. For that you would need a macro to update the field. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Francis, OK, so provided the Dropdown has the Apple" and "Strawberry" options, all you need to do is to protect the document for forms and select one of those options from the Dropdown. "Francis Ang" wrote in message ... Hi, I am new at this. What do you mean the dropdown option has to be coded? The {} were created using Ctrl+F9. The dropdown option 'calculate on exit' has been set. Dropdown option is Bookmarked as Dropdown1 What else do I have to do? "macropod" wrote: Hi Francis, The braces *should* disappear, leaving you with the results of the IF test showing. If the default Dropdown option has not been coded for, nothing will show. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... Hi, I did all the you have mentioned. However, I did notice that when I proctect the document, the curly brackets disappear. I must have done something wrong but I can't figure it out. "Graham Mayor" wrote: Did you use CTRL+F9 for each pair of brackets? Is the dropdown field named Dropdown1 or something else? If something else, change the REF fields to reflect the correct name. Is the condition spelled exactly the same as in the dropdown? The condition is case sensitive You could use {IF{REF Dropdown1 \*Upper} = "APPLE" "Green"} etc to eliminate the case sensitivity. Did you actually tab out of the dropdown field to force the update? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Francis Ang wrote: Hi, Thank you very much for the quick response. I followed your advice and did the following - Press Ctrl+F9 to get the {} Put in the formula between the {} The Dropdown field is set to 'calculate on exit' Proctect the document. When I select the item in the dropdown list, nothing happen! Did I do something wrong? "macropod" wrote: Hi Francis, Yes, you can do this without vba. With your dropdown formfield, make sure it: 1. has a bookmark name; and 2. is set to 'calculate on exit'. You do this via the formfield properties. Then, where you want the response to appear, insert a series of formula fields coded as: {IF{REF Dropdown1} = "Apple" "Green"} {IF{REF Dropdown1} = "Strawberry" "Red"} etc, where 'Dropdown1' is you formfield's bookmark name. The fields can all be on one line - I've put each on its own line for clarity. Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message. -- Cheers macropod [Microsoft MVP - Word] "Francis Ang" wrote in message ... I have a dropdown and textbox fields in my document. When an item is selected from the dropdown field, textbox get filled in automatically. eg. if item 'apple' is selected, the textbox will be populated with 'green' and if item 'strawberry' is selected, the textbox is pouplated with 'red', etc. Can this be achieved without using VBA? Any help is very much appreciated. Thank you. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill 2nd Field from Dropdown menu- HELP ! | Tables | |||
Hide DropDown Form (field) Box when printing | Microsoft Word Help | |||
add more than 25 items to dropdown field | Microsoft Word Help | |||
dropdown field with optional text entry | Microsoft Word Help | |||
a field to show additions of contents in dropdown fields | Microsoft Word Help |