D
Duncan Edment
A form in my database shows a date, a start time and an end time.
In the OnCurrent event, I have VBA code to calculate several values based on the
recorded times in the database. However, if I move to the next record--which
might hold the same date as the previous record--it re-calculates the values.
What I want it to do, is only re-calculate if it has to, i.e. if the date has
changed.
For example, an entry may be:
12/08/04 09:00 13:50
When the form loads, several calculated fields display time values based upon
hours for the current day & the current week. If I move to the next record, it
may display the following:
12/08/04 13:50 17:00
Obviously, I don't want to re-calculate the time values, as nothing has changed.
Moving to the next record may display:
11/08/04 09:00 17:00
At this point, I would want it to re-calculate the value for the daily figure,
as we have moved to a different day. Moving to the next record again, may
display:
05/08/04 09:00 12:10
Here, I would want it to not only re-calculate the daily figure, but also the
weekly figure, as we have moved to a new day and a new week.
Is this possible, and if so, how?
Many thanks for your help & regards
Duncan
--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.
Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.
In the OnCurrent event, I have VBA code to calculate several values based on the
recorded times in the database. However, if I move to the next record--which
might hold the same date as the previous record--it re-calculates the values.
What I want it to do, is only re-calculate if it has to, i.e. if the date has
changed.
For example, an entry may be:
12/08/04 09:00 13:50
When the form loads, several calculated fields display time values based upon
hours for the current day & the current week. If I move to the next record, it
may display the following:
12/08/04 13:50 17:00
Obviously, I don't want to re-calculate the time values, as nothing has changed.
Moving to the next record may display:
11/08/04 09:00 17:00
At this point, I would want it to re-calculate the value for the daily figure,
as we have moved to a different day. Moving to the next record again, may
display:
05/08/04 09:00 12:10
Here, I would want it to not only re-calculate the daily figure, but also the
weekly figure, as we have moved to a new day and a new week.
Is this possible, and if so, how?
Many thanks for your help & regards
Duncan
--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.
Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.