1 person found this helpful
Can you post the form?
I uploaded the form. So you know whick Items I am talking about I circled them. Let me know what you come up with. Also is there a way to add documents to this? Everytime I try to do anything to it I get the error about it being an xml form.
014FORM - REV 4.pdf 256.1 K
1) Calculating total mileage. I would avoid using form field names that include a period (.). The parser gets confused. I renamed the fields in the attached.
2) Calculating elapsed time. I am not sure what unit of elapsed time you are trying to calculate given you have the enter events on the StartTask and EndTask set to initialize and format the current time to the second. As a result, I added a calculate script on the TotalTask to generate the elapsed time in seconds. I included the commented calculations for minutes and seconds as well.
// topmostSubform.Page1.TotalTask::calculate - (FormCalc, client)
if (HasValue(StartTask) and HasValue(StopTask)) then
var Interval = Time2Num(StopTask.formattedValue, "HH:MM:SS A") - Time2Num(StartTask.formattedValue, "HH:MM:SS A")
// elapsed time in seconds
$.rawValue = Interval/1000
// elapsed time in minutes
// $.rawValue = Interval/(1000 * 60)
// elapsed time in hours
// $.rawValue = Interval/(1000 * 60 * 60)
endif3) Button to pencil tool. I have no idea.4) You can add documents as attachments in Acrobat using the paper clip in the navigation panel.Steve
014FORM - REV 4_SW.pdf 265.0 K
Thank you for the helpful hints, and the coding. I knew that the Mileage would be easy... As far as the time goes it did not work, striaght from the edited document, I added the times in both locations, and was not able to get a number calculated, is there a key stroke or something that I am missing?
Hmmm. Try removing the formatted value option in the Time2Num functions.
var Interval = Time2Num(StopTask) - Time2Num(StartTask)
PERFECT!!!!!! Oh this is sucfh a life saver!!!! Thank you for all of your help.
Ok, I have one more question. I got a request to have the Total Time to be rounded to the nearest 1/4 hour. I have tried to get that information, but no luck, do you have any ideas?