Microsoft Office Forums Help with Cascading Dropdown List

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2019, 09:37 PM
Abdelrahman Abdelrahman is offline Help with Cascading Dropdown List Windows 10 Help with Cascading Dropdown List Office 2019
Novice
Help with Cascading Dropdown List
 
Join Date: Jun 2019
Posts: 4
Abdelrahman is on a distinguished road
Default Help with Cascading Dropdown List

Hi
When I modified the defined list in "Master" and "Slave" list in https://www.msofficeforums.com/word-...down-list.html to include about 9 options and associated 1 to 9 different slave options, the drop down list is not working anymore. Can you please help?

I pasting what I did:
Code:
Option Explicit
Dim StrOption As String
Private Sub Document_ContentControlOnEnter(ByVal CCtrl As ContentControl)
If CCtrl.Title = "Master" Then StrOption = CCtrl.Range.Text
End Sub

Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim i As Long, StrOut As String
With CCtrl
  If .Title = "Master" Then
    If StrOption = .Range.Text Then Exit Sub
    Select Case .Range.Text
      Case "Design"
        StrOut = "Inadequate Design,Incorrect design methodology"
      Case "Communication"
        StrOut = "No communication,Ineffective communication,Wrong message provided,Misunderstanding/misinterpreting message,Lack of/Awaiting on required information"
      Case "Plant and Equipment"
        StrOut = "Wrong plant/equipment used,Non compatible plant/equipment used"
      Case "Planning"
        StrOut = "Inadequate resource planning,Inadequate scope planning,Inadequate time planning"
      Case "Error/Violation"
        StrOut = "Poor workmanship,Non-compliance with plant/equipment's O&MM recommendations,Lack of supervision,Non-compliance with work methodology,Non-compliance with specification/acceptance criteria,Non-compliance with documented procedure/process,Unexpected Machine/Equipment Operational Failure,Operator Error,Operator lack of experience/competency/skill"
      Case "Materials Availability and Suitability or Quality of Material"
        StrOut = "Using non-approved material,Poor quality material,Defective material used"
      Case "Congestion/Restriction/Access"
        StrOut = "Inadequate space,Restrictions in place,Inadequate access"
      Case "ITP/Process Control"
        StrOut = "Lack of adoption of ITP control,Non-compliance with an ITP control"
      Case "Abnormal operational situation/condition"
        StrOut = "Inclement Weather Condition"
      Case "Document Control Management"
        StrOut = "Using superseded document,Non-availability of IFU document"
      Case "Subcontractor Management"
        StrOut = "Requirement not communicated to subcontractor,Lack of supervision on site"
      Case Else
        .Type = wdContentControlText
        .Range.Text = ""
        .Type = wdContentControlDropdownList
    End Select
    With ActiveDocument.SelectContentControlsByTitle("Slave")(1)
      .DropdownListEntries.Clear
      For i = 0 To UBound(Split(StrOut, ","))
        .DropdownListEntries.Add Split(StrOut, ",")(i)
      Next
      .Type = wdContentControlText
      .Range.Text = ""
      .Type = wdContentControlDropdownList
    End With
  End If
End With
Application.ScreenUpdating = True
End Sub


Last edited by macropod; 06-10-2019 at 09:48 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 06-10-2019, 09:56 PM
macropod's Avatar
macropod macropod is offline Help with Cascading Dropdown List Windows 7 64bit Help with Cascading Dropdown List Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,662
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

It works for me. See attached.
Attached Files
File Type: docm Content Controls - Dependent Dropdown (1).docm (42.1 KB, 7 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 06-10-2019, 10:19 PM
Abdelrahman Abdelrahman is offline Help with Cascading Dropdown List Windows 10 Help with Cascading Dropdown List Office 2019
Novice
Help with Cascading Dropdown List
 
Join Date: Jun 2019
Posts: 4
Abdelrahman is on a distinguished road
Default Macro not working in my drop down list

Hi Paul
Thank you for your response.
Can you please look into the attached why it is not working? is it related to the format because the cells are horizontal?
Thank you for your time.
Attached Files
File Type: docm Casual Factor.docm (20.8 KB, 3 views)
Reply With Quote
  #4  
Old 06-10-2019, 10:22 PM
macropod's Avatar
macropod macropod is offline Help with Cascading Dropdown List Windows 7 64bit Help with Cascading Dropdown List Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,662
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

There is no code in your attachment...

In any event, if you're going to have multiple 'master' and 'slave' content controls, you'll need to change the way you reference them in order to maintain the correct relationships between them.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 06-10-2019, 10:29 PM
Abdelrahman Abdelrahman is offline Help with Cascading Dropdown List Windows 10 Help with Cascading Dropdown List Office 2019
Novice
Help with Cascading Dropdown List
 
Join Date: Jun 2019
Posts: 4
Abdelrahman is on a distinguished road
Default

Thanks Paul
I have fixed (by adding) the code.
Can you please help how should I change the way they are referenced?
Thanks
Abdel
Attached Files
File Type: docm Casual Factor.docm (32.1 KB, 2 views)
Reply With Quote
  #6  
Old 06-10-2019, 10:39 PM
macropod's Avatar
macropod macropod is offline Help with Cascading Dropdown List Windows 7 64bit Help with Cascading Dropdown List Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,662
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

See attached.
Attached Files
File Type: docm Casual Factor (1).docm (36.7 KB, 10 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #7  
Old 06-10-2019, 11:15 PM
Abdelrahman Abdelrahman is offline Help with Cascading Dropdown List Windows 10 Help with Cascading Dropdown List Office 2019
Novice
Help with Cascading Dropdown List
 
Join Date: Jun 2019
Posts: 4
Abdelrahman is on a distinguished road
Default

Thank you, you are a legend!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Cascading Dropdown List Help with cascading dropdown list SaraO Word VBA 25 07-01-2019 07:19 AM
The same cascading dropdown lists several times in a document al9512 Word VBA 1 08-10-2018 04:42 AM
Help with Cascading Dropdown List Use the Same Cascading Dropdown Info Multiple Times Inger70 Word VBA 2 08-10-2018 04:41 AM
Help with Cascading Dropdown List A Userform and 4 Cascading List Boxes TheSwede Excel 3 04-02-2017 01:27 PM
Help with Cascading Dropdown List Linking WORD Cascading Dropdown Boxes to Excel music_al Word VBA 6 02-15-2016 03:56 PM


All times are GMT -7. The time now is 03:50 PM.


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