Setting values based on other controls value - InfoPath Dev
in

InfoPath Dev

Setting values based on other controls value

Last post 06-19-2007 04:17 PM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-18-2007 01:23 PM

    Setting values based on other controls value

    Hi All,

     

    I have a form where there are lot of list boxes and date pickers. If Date Picker B = 07/20/07 and Date Picker C = 06/30/2007 then Date picker A should take the value in B.  When the date has been set the corresponding List value for A (False) should take the List value in B (eg. False).

    How is this possible.

    Thanks,

    Rajeev.

    Filed under: ,
  • 06-19-2007 01:53 AM In reply to

    Re: Setting values based on other controls value

    I'm having a hard time understanding this question.  Are the dates in B and C actually literal dates or is there some kind of relationship between them that when fulfilled should set A = B?  Also, what is in the drop-down list?

    An explicit example would be helpful to solve this.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-19-2007 01:27 PM In reply to

    Re: Setting values based on other controls value

    Hi Matt,

    Below is a representation with values filled in for some fields on a Form.

    RequestDate : (Should get value -  05/29/2007)      

    ReceiptDate : (Should get value - 06/10/2007)

    Status :    (Should get value SeriousIssues)              

    Duration :  __ days. (Should get value 13 )

    TestRequestDate :  05/29/2007       TestReceiptDate : 06/10/2007

    TestStatus : Manageable Issues

    CertRequestDate :  06/01/2007       CertReceiptDate :06/02/2007

    CertStatus : SeriousIssues

    The functionality I need is :

    When user enters or changes values for the fields (eg; filled in values shown), the fields (RequestDate, ReceiptDate, Status, Duration) have to be set with the values.

    The field RequestDate should be set with the lowest date as on a xxxRequest field value in the form.

    The field ReceiptDate should be set with highest date as on a xxxReeceipt field value in the form.

    The field Status should be set with highest status code as on a xxxStatus field value in the form.

    The field Duration should be set with the diference in number of days between "ReceiptDate" and "RequestDate".

    Hope I have given you enough details.

    Thanks & Regards,

    Rajeev.

  • 06-19-2007 04:17 PM In reply to

    Re: Setting values based on other controls value

    Hi Rajeev,

    Whew, that sure is a lot of date fields! InfoPath 2007 is a little bit better about doing calendar comparisons, but I don't know if it can handle all of this.  I would add code that runs on the OnAfterChange event on each of the date pickers that gets all of the values from the date pickers, loads them into DateTime objects (from .NET), compares them, and then sets the RequestDate, ReceiptDate, and Duration values from those comparisons.

    If you need information on parsing the date picker control values into DateTime objects, just do a search for all of the parsing methods available with that object.

     I hope this helps!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.