#1
|
|||
|
|||
Error Message
I have a question:
Based on a selection in a Combo Box of either Akron, Cincinnati, Columbus, Dayton, Youngstown. Populate five different Text Box? For example, If I select "Akron" in the Combo Box? The following Text Boxes 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 It was suggested to use the following code: I put the example in my letter. In the letter, I also have other Combo boxes. When I add the code below I get an 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 ___________________________________________ Any assistance would be great. |
#2
|
||||
|
||||
Your code is evidently derived from:
https://www.msofficeforums.com/word-...html#post46903 For different elements from a selected item to be output to different content controls, see: https://www.msofficeforums.com/word-...tml#post120392 later is the same thread.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
No known fix for this error message... | Aymincendiary | PowerPoint | 1 | 09-03-2017 05:38 PM |
Reserved error(-1517); there is no message for this error | ktest | Office | 1 | 02-12-2016 08:08 PM |
Automation error Unknown error" message once they open the Excel file | hlina | Excel | 1 | 10-08-2013 09:14 PM |
Error message | White House | Outlook | 1 | 12-07-2010 04:52 AM |
sent mail error message | Carolemc | Outlook | 0 | 09-26-2006 03:21 AM |