Consulting

Results 1 to 2 of 2

Thread: Word- Autofill text based on 2 seperate dropdowns

  1. #1
    VBAX Newbie
    Joined
    Mar 2023
    Posts
    1
    Location

    Word- Autofill text based on 2 seperate dropdowns

    TIA for the help.

    I am using legacy fields to create a form that is fairly automated. Most of this is going well, however I want to get a Text Form Field to autofill depending on 2 dropdown options.
    The first of these dropdowns are a set of names and the 2nd dropdown autofills with possible qualifications for the given person. This section of code is working fine, but I want to to autofill a Text Form Field with the numerical string associated with the specific persons specific qualification. How do I write the code to get the Text form to fill depending on the other 2 options?

    Current code using if statements, not perfectly copied, but shows the base of the code...

    Dim xName As FormField
    Dim xCompetency As FormField
    Dim xNumber As FormField
    Set xName = ActiveDoc...
    Set xCompetency = ActiveDoc...
    Set xNumber = ActiveDoc...
    If xName = "Bob" And xCompetency = "Red" Then
     xNumber = "1234"
    End If

    Cheers for the help
    Last edited by Aussiebear; 03-28-2023 at 06:06 AM. Reason: Added code tags to the supplied code

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,057
    Location
    Welcome to the VBAX forum Gregor, When submitting code we would prefer you to wrap your code with tags either by selecting your code then click the # icon or by selecting the # icon and then inserting your code within. For some reason your thread was marked as "Solved", strange given that no reply has yet been submitted.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •