query sql via infopath button - InfoPath Dev
in

InfoPath Dev

query sql via infopath button

Last post 07-26-2006 01:11 AM by jonboy05. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-25-2006 07:52 AM

    query sql via infopath button

    I am building a form and wish to use a button to move to a new view. At the same time the button has to pass only one record form the database to the new view so it can be edited.

    How would I do that?

    thanks

    jonathan
  • 07-25-2006 08:15 AM In reply to

    Re: query sql via infopath button

    Hi Jonathan and welcome to the forum!

    You could do this with either rules or code, but rules would probably be the easiest to implement. First, drop your button wherever you want it to be displayed, and then double-click it. Click Rules, and then click Add. Name it something descriptive and then click Add Action. You want this to fire all the time, so don't worry about adding a condition. For the first action select "Query a data source" from the drop-down menu, choose the data source to be queried, and then click OK. Now, click Add Action again, but this time choose "Switch to another view", select the view you would like to switch to, and then click OK until you are back to where you started.

    Hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-25-2006 08:25 AM In reply to

    Re: query sql via infopath button

    The button is only passing over the first record in the database and not the record next to the button in my repeating table.

    The button is on the same row as the record and it should only display that record after it is pressed.

    thanks
  • 07-26-2006 12:25 AM In reply to

    Re: query sql via infopath button

    Hi jonboy05,
    Hope my understanding is right.

    Your first view contains a repeating table containing multiple rows.And each row contains a button.So on clicking the button in row1, u should be able to modify the row1 details in another view.

    U can use code to achieve this.
    Follow the following steps.
    1)On the onclick event of the row1 button,use a web service to query the database and fetch the row1 details.

    2)So u have the row1 details in secondary datasource fields.Transfer them to fields in main datasource and display these in view2.

    3)In view2, the user will edit the details and click on a "Ok" button.

    4)On the onclick event of the "Ok" button in view2,update the edited data in the database,refresh the repeating table in view1 so that it displays updated data, and switch view to View1.

    Regards,
    Abhishek
  • 07-26-2006 01:11 AM In reply to

    Re: query sql via infopath button

    Sorry you lost me on that Abhishek.

    View 1 shows only two fields from the sql database that the form is linked to.

    View 2 is going to be the edit view but as you can tell I can not get my head around the way to pass the record id from view 1 from view 2.

    can this by done by a rule as I can not code?

    Thanks
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.