If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Time calcuation in a form?
I have a form that has time fields [Timefrom] and [Timeto] and [Total]. The
times represent the period of time a vehicle was off the road. eg. 14:20pm - 15:35pm, should read 1:15 in the [Total] field, i want to set the [Total] default value to work this out so i dont have to enter it. I've tried entering things into the field/ properties/ defualt value, found on here but cant get a good result. Should the field be a text box or a time field? that has my table as its source? I want the Total lost time to be entered onto my table also. Sorry if this seems simple but i'm a complete beginner. My table is called LostMilesTBL if it helps. |
#2
|
|||
|
|||
Time calcuation in a form?
The Date/Time data type is used to display "point-in-time" information, not
"duration". You'll need to use a text type control, and you'll need to build a parsing routine. Take a look at the DateDiff() function to find the difference (hint: use "minutes"), then use your parsing routine to divide minutes by 60 (the "hours" part) and the Mod() function (to find remainder--the "minutes" part) and finally to concatenate them with the proper punctuation. Regards Jeff Boyce Microsoft Office/Access MVP "jackrobyn1" wrote in message ... I have a form that has time fields [Timefrom] and [Timeto] and [Total]. The times represent the period of time a vehicle was off the road. eg. 14:20pm - 15:35pm, should read 1:15 in the [Total] field, i want to set the [Total] default value to work this out so i dont have to enter it. I've tried entering things into the field/ properties/ defualt value, found on here but cant get a good result. Should the field be a text box or a time field? that has my table as its source? I want the Total lost time to be entered onto my table also. Sorry if this seems simple but i'm a complete beginner. My table is called LostMilesTBL if it helps. |
Thread Tools | |
Display Modes | |
|
|