how do i insert only time and not date

J

Jesse

I have created a form to keep up with time spent on a project. I inserted a
button called "Start Time" and a textbox under it. One button called "End
Time" with a text box under it. Now I want to be able to click on buttons
and insert the time, only time not date in the text boxes and eventually
calculate how much time was spent on a project. So in need start time, end
time and difference of the two. Is this possible? Does anybody have any
idea how to go about that?
 
M

Mark L

sHi Jesse,

You will need 2 text boxes and two buttons for the start and end time. you
don't need to put any logic into the text boxes only into the buttons. BUT,
you will need to set the Data Type of the text boxes to Time (time), and set
the format of it to *9:99 AM. Now in the button, double click for
properties, then click the rules button, click add, you can name the rule
whatever you like. leave the condition as is (this rule always applies) then
click add action, leave the default action of 'set a fields value,' for the
field select the text box of the start time, then click the fx button next to
the value box, for the formula enter 'substring(now(), 12, 8)'...this will
populate the text box with the current time. As far as the calculation is
concerned, take a look at the following article:

http://blogs.msdn.com/infopath/archive/2007/02/21/calculating-elapsed-time-without-code.aspx

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top