Calculating values based on DDL Selection - InfoPath Dev
in

InfoPath Dev

Calculating values based on DDL Selection

Last post 01-10-2007 11:17 AM by thaddeus76. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-05-2007 11:21 AM

    Calculating values based on DDL Selection

    Hello,
    I'm creating a daily detail log for a friends construction company in Infopath 2003. What I've done is create a repeating section which will represent a particular day of the job. Inside of this repeating section will be the repeating table which will display the equipment used that day and for how long. The equipment will be in a drop down list format and the quantity will be in double format.

    In the repeating table, I created just one row that looks like this:

    Equipment | Worker | Quantity
    Drop Down | Drop Down | Decimal value in a Txt Box

    As he fills out the table, he can add rows as appropriate for that day's equipment usage. When it comes to the next day of the job, he will select the repeating section to create another "day", with a new embedded repeating table and so on.

    What I ultimately want to do is total the numerical values, from each section, at the bottom of the page based on the drop down list selection. In other words, if he chose the Chain Saw on day 1, 3, and 4 for 6 hours a day, at the bottom, I would like to see :

    Chain Saw 18 hours

    The Master/Detail looked promising, but I ran into the same problem of not being able to add like values together. I have a feeling that somehow I have to work in the primary key that's built into the Access "equipment database", and get the control to sum similar keys. Is this possible using expressions built into infopath or will I have to create code to solve this problem?

    Thank you for your time in advance. I apologize if this is an obvious question. This is my first infopath experience and the learning curve is near vertical.






  • 01-08-2007 10:16 PM In reply to

    Re: Calculating values based on DDL Selection

    Hello Thaddeus and Welcome to Forums,
    To add the total hours used for tool you will need to add a new text field on which will have to calculate the value. For doing that follow these steps:
    1. Double click the newly added text field
    2. Click on fx button in Default Value section in Data tab
    3. Click on “Insert Function…” button in Insert Formula dialog box
    4. Select “Math” in Categories, “Sum” in Functions and click on OK in Insert Function dialog box
    5. Double click on “double click to insert field” select the Quantity field
    6. Click on Filter Data… button and click on Add… button
    7. Select “Equipment” field in first drop down, “is equal to” value in second drop down and “Type text” in 3rd drop down
    8. Type Chain Saw in 3rd drop down and Click OK for Five times
    9. Preview the form, add all tools hours and see the newly added field
    For each equipment you need to add a new field

    Hope this helps!
  • 01-10-2007 11:17 AM In reply to

    Re: Calculating values based on DDL Selection

    Thank you very much for your help.

    I tried that out and I was only able to sum rows for the *same* repeating table based on the DDL selection. Unfortunately, I have it set up where a table represents one day.

    When I selected a new section below (to create another day of the "job") with a new repeating table for equipment, it didn't recognize the previous sections table entries and then add them together.

    How do I get a grand total from all the sections.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.