Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2017, 05:54 PM
gmaxey gmaxey is offline Word Template with a drop down list to populate other fields Windows 7 32bit Word Template with a drop down list to populate other fields Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You have already been given the solution to this requirement practically on a silver platter. If you are then going to move the goal post after the start of the game at least take the time to read and try to apply it.

Basically you need to change your OnEntry procedure as such:

Private Sub Document_ContentControlOnEnter(ByVal oCC As ContentControl)
Dim lngIndex As Long
Dim strSQL As String
Select Case oCC.Title
Case "Client"
oCC.DropdownListEntries.Clear
strSQL = "SELECT * FROM [Sheet1$];"
xlFillList arrData, ThisDocument.Path & "\Providers.xlsx", "True", strSQL
For lngIndex = 0 To UBound(arrData, 2)


'Since you have a gazillion empty records in your excel file:
If Not IsNull(arrData(0, lngIndex) Then
oCC.DropdownListEntries.Add arrData(0, lngIndex), arrData(0, lngIndex)
End If
Next lngIndex
End Select
End Sub

The rest of the code would be edited accordingly (e.g., the OnExit) and all the rest of the CCs should be text CCs.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA coding for multiple drop-down lists to populate a text box for each list yeatropulo Word VBA 14 11-11-2015 01:08 PM
Error 5941 when running my macro to auto populate fields throughout the word doc VBAnovice1 Word VBA 2 05-26-2015 01:35 AM
Populate Word Drop-down list with Excel column then auto fill form fields with Excel data Faldinio Word VBA 7 10-19-2014 06:03 AM
Word Template with a drop down list to populate other fields how do I auto-populate a word template Greenhorn Word 4 09-05-2012 04:16 PM
Word Template with a drop down list to populate other fields MSWord forms use list to populate successive text fields 2surgeons Word 4 03-05-2012 07:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft