Using InfoPath Forms to Query a Database
InfoPath builds a basic query page for you when you create a form from a database. To view it, open the Views task pane and select Query:
You should see a basic query page something like this:
The New Record and Run Query buttons already work. To change the label of a button, double-click it and, in the Button Properties dialog, enter a new label:
All you need to do to complete the form now is to edit and format the fields and labels the way you want them:
Preview the form. Enter or select some data to search by and then click the Search (or Query) button. InfoPath uses the data entry view to return the results:
In this view, the user can update the information in the record, adding new table rows or sections as appropriate.