Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-19-2019, 04:38 AM
AOSMITH AOSMITH is offline Show/Hide content based on dropdown value Windows 10 Show/Hide content based on dropdown value Office 2013
Novice
Show/Hide content based on dropdown value
 
Join Date: Nov 2019
Posts: 2
AOSMITH is on a distinguished road
Default Show/Hide content based on dropdown value

I have a word document and I am required to show different text based on what the value of the dropdown is.



I've created a dropdown, Dropdown1, which has three options: "FIRST" "SECOND" "THIRD".

All three options will display different text.

I read here: "https://answers.microsoft.com/en-us/msoffice/forum/all/word-2003-using-a-dropdown-to-show-hide-a-table/71da1c6e-09a5-43d8-adf9-c688956c8abe?page=1" that all I need to include is this:

{If {Dropdown} = "FIRST" "TEXT TO SHOW HERE"}

This does nothing at all. I am using the brackets generated by Ctrl + F9.

Am I putting this code in the wrong place? where is the right place?

Any help appreciated.

Thanks
Adam
Reply With Quote
  #2  
Old 11-19-2019, 02:16 PM
macropod's Avatar
macropod macropod is offline Show/Hide content based on dropdown value Windows 7 64bit Show/Hide content based on dropdown value Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See, for example: Form auto fill based on a different field value.
Your:
{If {Dropdown} = "FIRST" "TEXT TO SHOW HERE"}
needs to be:
{If {REF Dropdown} = "FIRST" "TEXT TO SHOW HERE"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-19-2019, 03:13 PM
Guessed's Avatar
Guessed Guessed is offline Show/Hide content based on dropdown value Windows 10 Show/Hide content based on dropdown value Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Fields are how you could do this with older doc files. If you are using docx files content controls are a better solution because the result is updated instantly (don't need fields to update to see the result). You also don't need to add multiple or nested fields to cater for each possible choice.

An example with linked content controls is demonstrated in https://www.msofficeforums.com/130893-post3.html
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 11-19-2019, 03:18 PM
macropod's Avatar
macropod macropod is offline Show/Hide content based on dropdown value Windows 7 64bit Show/Hide content based on dropdown value Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Guessed View Post
content controls are a better solution because the result is updated instantly (don't need fields to update to see the result).
Fields in documents using dropdown formfields also update immediately they are exited...
Quote:
Originally Posted by Guessed View Post
An example with linked content controls is demonstrated in https://www.msofficeforums.com/130893-post3.html
Note the caveat in that thread - the solution only works with Word 2013 & later. Formfields work with all Word versions.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-19-2019, 05:59 PM
Guessed's Avatar
Guessed Guessed is offline Show/Hide content based on dropdown value Windows 10 Show/Hide content based on dropdown value Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I didn't know that the fields updated on exiting a dropdown formfield. That is handy. The other issue of the multiple (or nested) If fields is kind of significant as well.

Although I don't have the older version of Word to test on, the feature that required Word 2013 was the repeating CC. The OP in this thread is not looking for that so I expect the dropdown functionality demonstrated there should work in Word 2007 and later.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #6  
Old 11-19-2019, 07:19 PM
macropod's Avatar
macropod macropod is offline Show/Hide content based on dropdown value Windows 7 64bit Show/Hide content based on dropdown value Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

With a dropdown formfield, you'd be matching exact values, so no nesting should be necessary unless you're doing something that combines its results with that of another formfield. For example:
{IF{REF Dropdown1}= "One" "One text"}{IF{REF Dropdown1}= "Two" "Two text"}{IF{REF Dropdown1}= "Three" "Three text"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
drop down list, if statement, showing massage

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM
Show/Hide content based on dropdown value Hide/Show text based upon check box status nathan.gray@emerson.com Word VBA 5 12-08-2017 01:08 PM
Help with show/hide content control acontreras Word VBA 0 10-21-2014 07:28 PM
Show/Hide content based on dropdown value Show/Hide Text based on Checkbox Selection tammytran105 Word VBA 7 10-02-2014 04:30 PM
Show/Hide content based on dropdown value Show/hide paragraphs based on upfront decisions miscia76 Word 1 11-13-2013 04:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft