Populating Dropdowns at Run-Time - InfoPath Dev
in

InfoPath Dev

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: Previous Next
  • 01-24-2006 09:51 AM

    Populating Dropdowns at Run-Time

    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

    Re: Populating Dropdowns at Run-Time

    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 Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-24-2006 12:12 PM In reply to

    Re: Populating Dropdowns at Run-Time

    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.