View Single Post
 
Old 07-20-2023, 11:39 AM
OldDogNewVisio OldDogNewVisio is offline Windows 11 Office 2016
Novice
 
Join Date: Jul 2023
Location: Florida
Posts: 7
OldDogNewVisio is on a distinguished road
Default How To Populate A Text Box From A ComboBox In Visio

We use Visio for our SharePoint Site. I have been asked to streamline things. Instead of posting the entire org chart, I have created a ComboBox that allows visitors to our site to select the department they are looking for and I would like to have the name of the lead for that department populate in a text box next to the dropdown list. I have created the subroutine for the dropdown list that opens when the SharePoint opens. I have added the list of department names (Example) as follows:

ComboBox2.AddItem ("Accounting")
ComboBox2.AddItem ("Maintenance")
ComboBox2.AddItem ("Commissary")
ComboBox2.AddItem ("Sales")
ComboBox2.AddItem ("Field Reps")
End Sub

I have created the text box statement as a long string if statement (example) as follows:

If (ComboBox2.Value= "Accounting") Then Textbox1.Value = "Mary Smith"
ElseIf (ComboBox2.Value= "Maintenance") Then Textbox1.Value = "Fred Jones"
ElseIf (ComboBox2.Value= "Commissary") Then Textbox1.Value = "Jose Lima"
ElseIf (ComboBox2.Value= "Sales") Then Textbox1.Value = "Rick Nixon"
ElseIf (ComboBox2.Value= "Field Reps") Then Textbox1.Value = "Sandy Banning"

End If
End Sub

These are only examples. I can't post the real thing but they are close approximations of what I'm doing. How do I get the two pieces to work together? I have loaded the ComboBox statement on the "Document" page in the VB editor but where do I put the If Statement text for the TextBox?

Thanks so much!!
Reply With Quote