Populating Dropdowns at Run-Time - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Populating Dropdowns at Run-Time Populating Dropdowns at Run-Time Last post 01-24-2006 12:12 PM by Lewis68. 2 replies. Page 1 of 1 (3 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 01-24-2006 09:51 AM Lewis68 Joined on 01-02-2006 Posts 29 Populating Dropdowns at Run-Time Reply Contact Hello,I know this has been covered before, but I can't seem to find an example. I need to populate a Dropdown with results from a SQL DB query at run-time. Can I get an example on how to do this?Thanks. 01-24-2006 11:01 AM In reply to Matt Faus Joined on 08-18-2006 Dallas, Texas Posts 1,558 Re: Populating Dropdowns at Run-Time Mark as Not AnswerMark as Answer... Reply Contact If your drop-down list is already populating from the SQL DB then all you need to do is retrieve the rows from the DB and the drop-down will automatically populate. To do this, add this code to your OnLoad event handler:XDocument.Query();--OR--XDocument.DataObjects("Name of secondary data source").Query();These two bits of code are the same thing as clicking the "Run Query" button generated on the form and can also be accomplished using rules of the Open/Save functionality in Form Options.---------------Matt FausInfoPath Dev Texas Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge 01-24-2006 12:12 PM In reply to Lewis68 Joined on 01-02-2006 Posts 29 Re: Populating Dropdowns at Run-Time Mark as Not AnswerMark as Answer... Reply Contact I got it to work.Thanks for the info. Page 1 of 1 (3 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.