Returning results from an Access Query - InfoPath Dev
in

InfoPath Dev

Returning results from an Access Query

Last post 07-13-2006 09:03 AM by Carolyn. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-10-2006 02:31 PM

    Returning results from an Access Query

    Hello,

    I have a series of MSAccess queries already created that I would like to link into Infopath. Two scenarios:

    1. Button click which links to the data source and returns the results. Rather simple, I'd think, but I can't get results to display.

    2. Button click which accepts a value, inserts that value into the Access query, and then returns the appropriate results. Perhaps not as simple...

    thanks for your help!

    Ryan.
  • 07-10-2006 10:05 PM In reply to

    Re: Returning results from an Access Query

    First I would create a new form based on a data connection to your access database. This is good practice and learning for you and will verify your connectivity.
    I would use a default form first to become familiar with the process and fields.

    Here is a link to a how-to that is helpful.
    http://office.microsoft.com/en-au/assistance/ha011199501033.aspx
  • 07-13-2006 07:53 AM In reply to

    Re: Returning results from an Access Query

    For the record, I, too, am potentially interested in doing the above, or something like it. (I like your #2 option...)

  • 07-13-2006 09:03 AM In reply to

    Re: Returning results from an Access Query

    You need to start a new form, using the "Design A Form New From Data Connection" choice. You will be prompted to enter your Access mdb.

    Make a note if the final screen of the Data Connection wizard tells you if Submit is enabled. If not, then note why not.

    Now, look at the Data Source pane. You'll see your Access fields there twice. One set are Query (q) fields and the other are Data (d) fields.

    Drag a query field into the proper layout table. (InfoPath creates two tables and two buttons automatically.)

    Next, drag your data fields into the other layout table.

    Preview the form and put something you know belongs to the db in the query field text box. Then click Query. You should see the appropriate data in the data field text boxes.

    A further refinement is to create, in Access, a query that returns just one field. Set that up as a secondary data source, then change your query field text box into a drop down. Use the secondary data source (the one-field query) as the source for the drop down. Next, set a rule that when that control (the drop down) changes, query the main db connection. That way you'll present the user with a list of appropriate choices, no guess work, and the db will automatically query after a choice has been made.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.