Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!! - InfoPath Dev
in

InfoPath Dev

Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!!

Last post 01-25-2014 08:41 AM by tiatia. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-09-2014 12:58 PM

    • tiatia
    • Not Ranked
    • Joined on 01-08-2014
    • Posts 4

    Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!!

    I hope you can help me. I have an info path web part form that is connected to an excel web part. I have 3 fields in the IP form that routes to excel for a calculation - # of employees reported, empSTHours, empOTHours. Upon button click on the form, the data populates in an excel spreadsheet with calculated combined straight time hours and combined over time hours. For example: 13 employees worked 8:00 straight time hours and 4:23 overtime. The total equals 104 straight time hours, 56:59 overtime hours and a total of 160:59. I want the user to enter the totals back in the info path form after calculations have been done and I want to require it to be in the same format as the fellow person in this post, i.e. 00:00. So, I followed all of the steps attached here and my form requires that the user enter the data as time up to 23:59. I need to format the cells, however, to allow for any time over 24 hours. So, for example, I need the user to be able to enter 104:00 in the combinedSTHours field, and 56:59 in combinedOTHours and 160:59 in totalHours. Can you help me?
     
    Thank you!
  • 01-10-2014 10:30 AM In reply to

    Re: Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!!

     So you want to have a field that requires the user to enter a value of the format AAA:BB where AAA is any whole number and BB is a number between 00 and 59 inclusive. Did I understand that right?

    If so, you can place a validation rule on the field to check whether the field does not match the pattern:

    \d+:[0-5]\d

    This will require making the data type an ordinary string data type, as the Time datatype requires the hours to be between 0 and 23.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-13-2014 08:13 PM In reply to

    • tiatia
    • Not Ranked
    • Joined on 01-08-2014
    • Posts 4

    Re: Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!!

    Exactly what I needed; thank you!
  • 01-25-2014 08:41 AM In reply to

    • tiatia
    • Not Ranked
    • Joined on 01-08-2014
    • Posts 4

    Re: Format text box for time that requires _ _ _ : _ _ format to allow for hours calculated to greater then 24 ----- Please reply quickly!!!

    Thank you again Jimmy. This leads me to another question - can I set an info path field to add the hours and populate a text field in this format?
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.