#1
|
|||
|
|||
Cascading Form Depending on Drop Down Option
Hello,
I am trying to create a referral form on Microsoft Word, in which the content of questions and dropdown answers visible change dependant on the first question and drop down option that is selected. Can someone let me know if this is possible on word, and if so how I could go about doing it? Many thanks ashraj0711 |
#2
|
||||
|
||||
Dependent Dropdown Content Controls
https://www.msofficeforums.com/word-...html#post77762 Hierarchical Dropdown Content Controls https://www.msofficeforums.com/word-...html#post94603
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Referral Form - Check Box
Hi Macropod,
Sorry, I don't think I am explaining myself very well and i'm very new to using Macros. I have attached a draft version of the form I am trying to create. Essentially, dependent on which services are selected/checked under Heading 1 (Service): I want the boxes only with that heading being displayed under heading 5. Is that possible / how would I go about doing this? (Hope that makes sense) Thanks in advance for your help! ashraj0711 |
#4
|
||||
|
||||
That is a rather different proposition. I would suggest creating custom Quick Parts for each of the options, which would be stored in the document's template (you might want to create a specific Word template for this). The template should be based on the basic layout, with a series of consecutive bookmarks, one for each option. A ContentControlOnExit macro could then be used to automatically insert/remove each Quick Part in accordance with the checked state of the corresponding checkbox.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Hi Paul,
Thanks for the above. I've created a custom quick park as discussed and I am running the following code: Private Sub CheckBox1_Click() If CheckBox1.Value = True Then ' ' AdultCommunityDiabetesReasonForReferral Macro ' Adult Community Diabetes Reason for Referral ' Application.Templates( _ "C:\Users\ThurairajA\AppData\Roaming\Microsoft\Doc ument Building Blocks\1033\14\Building Blocks.dotx" _ ).BuildingBlockEntries("AdultCommunityDiabetes").I nsert Where:=Selection. _ Range, RichText:=True Else: End If End Sub However, it seems the custom quick part is saved to my temporary files and not the actual document itself. How would I go about ensuring its part of the template? Also the Macro I am running inserts the quick part exactly where the checkbox is: could you let me know how to code the position at which I want the macro to run? thanks Ash Thanks Ash |
#6
|
||||
|
||||
Quote:
Quote:
Where:=Selection. _ Range with: Where:=ActiveDocument.Bookmarks("AdultCommunityDia betes").Range where 'AdultCommunityDiabetes' is the bookmark name.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Hi Paul,
thanks for the above. I have now got the code below working but only on my computer. I think the issue is in where I have highlighted red: I think I need to find a way for this path to always be the active document so that the macros work correctly when I send the document to other users. Any idea how I can do this? Private Sub CheckBox1_Click() Selection.EndKey Unit:=wdStory If CheckBox1.Value = True Then ' ' AdultCommunityDiabetes Macro ' ' Application.Templates( _ "H:\Coding Files\Referral Form Combined (Template).dotm"). _ BuildingBlockEntries("AdultCommunityDiabetes").Ins ert Where:=Selection. _ Range, RichText:=True Else: End If Selection.HomeKey Unit:=wdStory End Sub Thanks Ash |
#8
|
||||
|
||||
As I said in post 4:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
ContentControlOnExit Macro
So I've done what you've said and created a template using a dotm file and created custom quick parts but the same problem arises.
I am not 100% sure what you mean by use a ContentControlOnExit Macro. Could you please explain this further? I've attached the updated template if that helps. Again, many thanks for your help! Ash |
#10
|
||||
|
||||
It seems you like creating moving targets. Your original document had content control checkboxes. The template in your latest attachment has ActiveX checkboxes. The links in post #2 both demonstrate possible uses of a ContentControlOnExit macro. It also appears you still haven't added any of your Quick Parts to this template.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
dependent, drop down, referral form |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cascading Drop Down | and23 | Word VBA | 8 | 05-23-2018 02:33 PM |
Userform with Multiple Cascading Drop Down Lists Populated with External Source Data | venganewt | Word VBA | 21 | 05-16-2018 02:05 PM |
Word document with text depending on drop down list option | miguelcane | Word VBA | 1 | 04-30-2018 06:51 PM |
Issue Using Word Document with Cascading Drop Down Lists | LynnMac2016 | Word VBA | 3 | 04-06-2016 06:15 AM |
Create a fillable form that changes a paragraph depending on what is chosen in a drop down list. | Sullivanaudio | Word VBA | 1 | 03-31-2015 10:45 PM |