View Single Post
 
Old 06-10-2019, 09:37 PM
Abdelrahman Abdelrahman is offline Windows 10 Office 2019
Novice
 
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