PDA

View Full Version : Word- Autofill text based on 2 seperate dropdowns



gregor
03-28-2023, 05:32 AM
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

Aussiebear
03-28-2023, 06:09 AM
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.