Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2021, 11:01 AM
shaun0406 shaun0406 is offline Cascading Combobox / Dependent Drop Down Windows 10 Cascading Combobox / Dependent Drop Down Office 2010
Novice
Cascading Combobox / Dependent Drop Down
 
Join Date: Dec 2020
Posts: 17
shaun0406 is on a distinguished road
Smile Cascading Combobox / Dependent Drop Down

Hi, I am am creating a form with 3 combobox dependent with each other.



I have referred to macropod's #12 post from
https://www.msofficeforums.com/word-...down-list.html

This work perfectly, but then I have a couple of situations where CB2 have the same choices with a different CB1, but CB3 is dependent to both CB1 and CB2

I have my combobox title as, Company, Program, Plan.

I was thinking of adding an if statement to check the value of the CB1 (Company)
Currently, my Company choices are AARP and AETNA

If .Title = "Program" Then

If StrOption = .Range.Text Then Exit Sub
Select Case .Range.Text
Case "MAPD"
' If (company value) = AARP then
' StrOut = "object1, object2, object3"
' End If
' If (company value) = AETNA then
' StrOut = "item1, item2, item3"
End If

Case Else
.Type = wdContentControlText
.Range.Text = ""
.Type = wdContentControlComboBox
End Select

I am having trouble coding the If statement, I am having trouble looking into grabbing the CB1 value and store it to a variable.

I have attached my document if you want a reference
Thanks!
Attached Files
File Type: docm YPageMedicareEdits.docm (58.9 KB, 1 views)
Reply With Quote
  #2  
Old 05-01-2021, 10:48 PM
gmayor's Avatar
gmayor gmayor is offline Cascading Combobox / Dependent Drop Down Windows 10 Cascading Combobox / Dependent Drop Down Office 2019
Expert
 
Join Date: Aug 2014
Posts: 3,446
gmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to allgmayor is a name known to all
Default

What I think you want from your description is

Code:
                Select Case .Range.Text
                    Case "MAPD"
                        If ActiveDocument.SelectContentControlsByTitle("Company").Item(1).Range.Text = "AARP" Then
                            'if MAPD and AARP, choices are object1, object2, object3
                            StrOut = "object1, object2, object3"    '"q,w,e"
                        Else
                            StrOut = "item1, item2, item3"
                            'if MAPD and AETNA, choices are item1, item2, item3
                        End If
                    Case "Supplement"
                        StrOut = "1,2,3"
                End Select
You might find Insert Content Control Add-In useful for creating and editing your content controls.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 05-08-2021, 07:41 AM
shaun0406 shaun0406 is offline Cascading Combobox / Dependent Drop Down Windows 10 Cascading Combobox / Dependent Drop Down Office 2010
Novice
Cascading Combobox / Dependent Drop Down
 
Join Date: Dec 2020
Posts: 17
shaun0406 is on a distinguished road
Default

This looks Great, Thanks!
Reply With Quote
Reply

Tags
casscading, combo box, dependent combobox

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascading Combobox / Dependent Drop Down Cascading drop-downs in Word with one parent menu and four dependent drop-downs mrstrawhand Word VBA 3 03-30-2020 06:08 AM
Cascading Combobox / Dependent Drop Down Cascading Form Depending on Drop Down Option ashraj0711 Word 9 05-16-2019 02:57 PM
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
Cascading Combobox / Dependent Drop Down Issue Using Word Document with Cascading Drop Down Lists LynnMac2016 Word VBA 3 04-06-2016 06:15 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 02:59 AM.


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