IP 2010 and MS Access - populate txt box based on query - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

IP 2010 and MS Access - populate txt box based on query

Last post 02-26-2013 10:47 AM by Mkyle. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-20-2013 11:17 AM

    • Mkyle
    • Not Ranked
    • Joined on 02-20-2013
    • Posts 3

    IP 2010 and MS Access - populate txt box based on query

    I have a question on whether or not I am doing something correctly or using best practice.  I have an estimate form that I am trying to convert from MS Excel to MS Infopath with a database table backend.  I'd like to store the estimate hour values in a MS Access database, but have an infopath form for the end user to complete.

    Current Situation:
    MS Access - 1 table for storing 4 fields/columns:
    1.)  System (two possible)
    2.)  New Change (two possible)
    3.)  Type of Change (10-12 posibilities)
    4.)  Hours  (this is the number I want stored for calculating and summing later on)

    Infopath:
    1.)  I have three combo boxes that successfully look at the MS Access database for the drop down values (points to secondary connection)
    2.)  Main connection established, with a secondary connection storing values to the form.

    Where I'm struggling:
    1.)  I cannot successfully query the database to extract the hours (field/column 4 in the Access database).  It always displays the first record of the table.
    2.)  Do I need a secondary connection if I'm just wanting to pull the hours from the same table (using only one table).

    Desired Outcome Example (Repeating Table):

    System:      N/C:       Type:   Hours:
    System1     New        Tool     XX
    System2     New        Code    XX
    System1     Change   Code    XX

    Total Hours:    YY

    Any thoughts or high level approaches is appreciated!!!

    Thanks!

     

     

  • 02-24-2013 01:05 PM In reply to

    Re: IP 2010 and MS Access - populate txt box based on query

    Hi MKyle,

    When you create an InfoPath form from a database, it should give you a form with a Query button. You can query the main data source for a record based on the field values. That will return one because it keeps the correspondence with a primary key.

    To return multiple values (for example, to display in a dropdown), you can create a secondary data source that queries the same table. You could use this as a kind of master-detail, just make sure you run the query when they select the item from the dropdown so the current record number is set correctly.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 02-26-2013 10:35 AM In reply to

    • Mkyle
    • Not Ranked
    • Joined on 02-20-2013
    • Posts 3

    Re: IP 2010 and MS Access - populate txt box based on query

    The problem I'm running into is that InfoPath expects the text box I want to store the value in to be associated with the database "Hours" field.  Using the templated Database form, I can't store the value in a text box for each repeating line.  Does that make sense?

     

  • 02-26-2013 10:47 AM In reply to

    • Mkyle
    • Not Ranked
    • Joined on 02-20-2013
    • Posts 3

    Re: IP 2010 and MS Access - populate txt box based on query

    Update - I was able to get the drop down's working and it successfully queries the hours of a single line.  Now where I'm having the problem is when I try to put the query into a repeating table.

    Current:
    System | N/C | Type = Hours
    <<Query Button>>

    Desired outcome is to have one query button on multiple lines in a repeating table:

    System | N/C | Type = Hours
    System | N/C | Type = Hours
    System | N/C | Type = Hours
    <<Query Button>>

     Thoughts???

     

     

     

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