none
InfoPath - loading data on Combo Box click RRS feed

  • Question

  • I would like to know if it possible to load data to an InfoPath Combo Box or Drop-Down List Box at run time when a user clicks on the field?

    I have a secondary data connection that is linked to a SQL Table, basically I want this data connection to run and populate the drop down when a user clicks on the drop down field. 

    Basically, I'm looking for something similar to the Clicked Even of a Button. So far I have found the changed event, but that will not work for me, as i need it to run on click, not after a user selects something.

    Public Sub field2_Changed(ByVal sender As Object, ByVal e As XmlEventArgs)
                ' Write your code here to change the main data source.
                Dim TitleConn As DataConnection = DataSources("EU").QueryConnection

                TitleConn.Execute()
            End Sub

    Sincerely,

    Alberto da Silva


    Alberto da Silva

    Tuesday, November 3, 2015 4:07 PM

All replies

  • I would like to know if it possible to load data to an InfoPath Combo Box or Drop-Down List Box at run time when a user clicks on the field?

    I have a secondary data connection that is linked to a SQL Table, basically I want this data connection to run and populate the drop down when a user clicks on the drop down field. 

    Basically, I'm looking for something similar to the Clicked Even of a Button. So far I have found the changed event, but that will not work for me, as i need it to run on click, not after a user selects something.

    Public Sub field2_Changed(ByVal sender As Object, ByVal e As XmlEventArgs)
                ' Write your code here to change the main data source.
                Dim TitleConn As DataConnection = DataSources("EU").QueryConnection

                TitleConn.Execute()
            End Sub

    Sincerely,

    Alberto da Silva

    • Merged by George123345 Wednesday, November 4, 2015 5:17 AM same topic
    Tuesday, November 3, 2015 4:04 PM
  • Hi Alberto,

    Did you develop Visual Studio Tools for Applciations (VSTA)?

    Where did you write code? As my research, an event handler is the function code in InfoPath form template that responds to a user action.

    You could refer the link below for more information.
    # Create an event handler
    https://support.office.com/en-au/article/Create-an-event-handler-86cb9f56-8a71-455e-93f7-cc320688d0b5

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, November 4, 2015 2:57 AM