![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a 2 questions:
1. How do I add the following selections (Akron Cincinnati, Columbus, Dayton , Youngstown) to a Combo Box(ActiveX Control)? 2. Based on a selection in the above Combo Box(ActiveX Control of either Akron, Cincinnati, Columbus, Dayton, Youngstown. Populate five different Text Box(ActiveX control)? For example, If I select "Akron" in the Combo Box(ActiveX Control)? The following Text Boxes(ActiveX controls) would populate. see below Combo Box 1 = Akron Text Box 1 = Kim Lee Text Box 1 = 123 No Name Street Text Box 1 = Cols, Oh 45623 Text Box 1 = 214-567-8954 Text Box 1 = klee@msn.com Any assistance would be great. Last edited by PointCheck; 08-08-2018 at 08:14 AM. Reason: New Question |
|
#2
|
||||
|
||||
|
One would have to ask why you're using an ActiveX Control for this. Unlike content controls and formfields, ActiveX Controls require a macro to populate them every time the document is opened. For a content control solution, see:
https://www.msofficeforums.com/word-...html#post46903 and, for different elements from a selected item to be output to different content controls, see: https://www.msofficeforums.com/word-...tml#post120392
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
I put the example in my form. When I add new dropdown boxes and select the example I get am error in the code (Orange section). Can you assist?
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim i As Long, StrDetails As String With ContentControl If .Title = "MBACRegion" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11)) Exit For End If Next ActiveDocument.ContentControls(2).Range.Text = StrDetails End If End With End Sub |
|
#4
|
||||
|
||||
|
Do you have a second (text) content control in the document for the output to go to?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA to provide text string with specific formating based on Drop down list (content control) | MP1989 | Word VBA | 4 | 07-30-2018 02:40 AM |
Creating text based on drop-down menu selection
|
emckillen | Word | 9 | 09-27-2017 04:52 PM |
Drop down lists and pulling data from worksheet based on drop down selection
|
cjoyce73 | Excel | 5 | 07-17-2017 07:40 AM |
Edit table cells based on content control selection
|
gennatr12 | Word VBA | 7 | 03-26-2017 08:51 PM |
| Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |