G
Guest
Using Access 2003....I have a db with a Truck Table and a Maintenance Records
table. There is a one to many relationship between the two of them based on
the Truck #.
I have a Truck form in single form view with a Maintenance Records subform
in continuous forms view that lists all the maintenance records for that
particular truck.
I have 2 calculated controls on my Maintenance form which need to look at a
previous record to do a calculation. The two controls are # of Miles and #
of Days. I need to put in a formula for each of them respectively that will
calculate the following:
1) The difference between the mileage from the previous maintenance record
(which will have to be by date-however I suppose there could be 2 records on
the same date) for that truck and the current (next) maintenance record's
mileage.
2) The # of days between the Service Date from the previous maintenance
record for that truck and the current (next) maintenance records' service
date.
I know how to do basic functions to calculate these if it were within the
same record, but I don't know how to make this happen to look at the previous
record (by date) and make the calculations BETWEEN the records.
I have a very small amount of experience with coding so I'm hoping this
isn't going to require writing some serious code to make it happen.
Thanks in advance,
Tammy
table. There is a one to many relationship between the two of them based on
the Truck #.
I have a Truck form in single form view with a Maintenance Records subform
in continuous forms view that lists all the maintenance records for that
particular truck.
I have 2 calculated controls on my Maintenance form which need to look at a
previous record to do a calculation. The two controls are # of Miles and #
of Days. I need to put in a formula for each of them respectively that will
calculate the following:
1) The difference between the mileage from the previous maintenance record
(which will have to be by date-however I suppose there could be 2 records on
the same date) for that truck and the current (next) maintenance record's
mileage.
2) The # of days between the Service Date from the previous maintenance
record for that truck and the current (next) maintenance records' service
date.
I know how to do basic functions to calculate these if it were within the
same record, but I don't know how to make this happen to look at the previous
record (by date) and make the calculations BETWEEN the records.
I have a very small amount of experience with coding so I'm hoping this
isn't going to require writing some serious code to make it happen.

Thanks in advance,
Tammy