S
Santara
I have two fields on my form for the miles driven in a days work. The first
field is StartMiles for the odometer reading at the beginning of the shift.
The second field is FinishMiles for the odometer reading at the end of the
shift. And of course there is a field called DailyMiles, that calcultes the
number of miles driven in the shift.
All this works fine.
Now...they want to have the system enter the StartMiles for a person from
the last time they worked based on the FinishMiles. Example: Bob worked
Friday July 8th with Start Miles of 6,500. He drove 75 miles, so at the end
of his shift the FinishMiles were 6,575. When he returns to work on Monday
July 11th, his next record entered should automatically reflect the
StartMiles as 6,575.
Keep in mind that their are 15 other cars being driven 24 hours a day by 18
other workers. So his next record will NOT follow in the table. There will
be multiple other records for other workers entered before he works again on
Monday.
Normally, they spend about 98% of their time in the same car, with no one
else driving that vehicle. However, they sometimes use a different car, and
would need an override for those times. When they are in a different car, it
is okay to bring forward that FinishMiles to his next record. It can then be
over ridden when he returns to his regular vehicle.
Here is an example of what happens for new records entered on the form:
When the form is opened, the user enters the UnitID number and then the
WorkDate. Now they choose the WorkStatus of On Duty. Several fields later
is the StartMiles field.
So what we need is for the system to identify WHO this record is for, then
search for the last date they were ON DUTY (From the WorkStatus field), find
the FinishMiles and bring that value forward and drop it into the StartMiles.
Something else, there can be records entered with WorkStatus of Vacation or
Holiday where there are NO miles entered for that record.
I don't even know where to begin fixing this problem. I thought about using
a DLookUp, but it doesn't seem to have the power for this problem.
Can some one help me with this problem?
Thanks!
Santara
field is StartMiles for the odometer reading at the beginning of the shift.
The second field is FinishMiles for the odometer reading at the end of the
shift. And of course there is a field called DailyMiles, that calcultes the
number of miles driven in the shift.
All this works fine.
Now...they want to have the system enter the StartMiles for a person from
the last time they worked based on the FinishMiles. Example: Bob worked
Friday July 8th with Start Miles of 6,500. He drove 75 miles, so at the end
of his shift the FinishMiles were 6,575. When he returns to work on Monday
July 11th, his next record entered should automatically reflect the
StartMiles as 6,575.
Keep in mind that their are 15 other cars being driven 24 hours a day by 18
other workers. So his next record will NOT follow in the table. There will
be multiple other records for other workers entered before he works again on
Monday.
Normally, they spend about 98% of their time in the same car, with no one
else driving that vehicle. However, they sometimes use a different car, and
would need an override for those times. When they are in a different car, it
is okay to bring forward that FinishMiles to his next record. It can then be
over ridden when he returns to his regular vehicle.
Here is an example of what happens for new records entered on the form:
When the form is opened, the user enters the UnitID number and then the
WorkDate. Now they choose the WorkStatus of On Duty. Several fields later
is the StartMiles field.
So what we need is for the system to identify WHO this record is for, then
search for the last date they were ON DUTY (From the WorkStatus field), find
the FinishMiles and bring that value forward and drop it into the StartMiles.
Something else, there can be records entered with WorkStatus of Vacation or
Holiday where there are NO miles entered for that record.
I don't even know where to begin fixing this problem. I thought about using
a DLookUp, but it doesn't seem to have the power for this problem.
Can some one help me with this problem?
Thanks!
Santara