Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2020, 11:52 AM
NLJ NLJ is offline Dependent dropdown and repeat section Windows 10 Dependent dropdown and repeat section Office 2016
Novice
Dependent dropdown and repeat section
 
Join Date: Jan 2020
Posts: 5
NLJ is on a distinguished road
Default Dependent dropdown and repeat section

I have no experience with VBA and really limited experience using content controls. I'm helping to create a report template to use for approximately a year until we get into an electronic system. The goal is to create efficiency and make reports quicker and easier to complete. There are several content controls and one section to allow free text and lists and a dependent relationship between category and sub-category. The entire section should be repeatable as each report will have a varying number of observations to include. I have been able to modify a VBA code from another website which works for one observation, but this won't work for any additional observations whether I copy and paste or use the section repeat content control. I'm not sure if this makes sense, but I'm hoping that someone can help.
Code:
Sub PopulateddCategory()
    Dim xDirection As FormField
    Dim xState As FormField
    On Error Resume Next
    Set xDirection = ActiveDocument.FormFields("ddCategory")
    Set xState = ActiveDocument.FormFields("ddSub")
    If ((xDirection Is Nothing) Or (xState Is Nothing)) Then Exit Sub
    With xState.DropDown.ListEntries
        .Clear
        Select Case xDirection.Result
            Case "Business Continuity Disaster Recovery"
                .Add "Adherence"
                .Add "Documentation"
                .Add "Procedure"
            Case "Computerized Systems Management"
                .Add "Adherence"
                .Add "Documentation"
                .Add "Procedure"
                .Add "Validation"
            Case "Contract  Agreement"
                .Add "Adherence"
                .Add "Documentation"
                .Add "Procedure"
            Case "Data Collection and Handling"
                .Add "Adherence"
                .Add "Documentation"
                .Add "Procedure"
                .Add "Source Data Verification"
            Case "Good Documentation Practices"
                .Add "Adherence"
                .Add "Procedure"
            Case "Records Management"
                .Add "Investigator Site File"
                .Add "Procedure"
                .Add "Trial Master File Master File"
            End Select
    End With
End Sub

Attached Files
File Type: docm Repeating Dependant DD Question.docm (61.4 KB, 13 views)

Last edited by macropod; 01-11-2020 at 01:31 PM. Reason: Added code tags
Reply With Quote
 

Tags
dependent vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dependent dropdown and repeat section Content Controls - Dependent Dropdown someazguy Word VBA 14 02-05-2023 08:01 PM
Dependent dropdown and repeat section Multiple dependent dropdown lists in table with add new row option jeweldarby Word VBA 6 05-21-2022 04:37 PM
Dependent dropdown and repeat section Dropdown Menu Dependent on a Previous Drop Down lgsikaffy Word VBA 3 12-14-2018 05:14 PM
Dropdown dependent text JakeLRL Word VBA 7 04-07-2016 08:26 AM
make text form field active dependent on dropdown Glenn0004 Word VBA 1 06-23-2015 06:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:55 PM.


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