D
Duncan Edment
My question is, I am sure, a simple one. But nevertheless, one which I
just can't seem to get a grip on.
Staff record their hours of work in an Access database, which helps to
detail what they have been working on, and how much should be billed to
the customer.
I have noticed however, that due to human error or whatever, some times
have been recorded incorrectly. For example:
Start End Description
09:00 11:00 PWHC Project
10:45 11:15 KPMG
Whilst the above times are indeed credible--i.e. an employee could be
working on two things at once, and is waiting for something to
finish--it's just not how we work. We have to end one project, before
starting work on another. So, a correct entry for the above, could be:
Start End Description
09:00 11:00 PWHC Project
11:00 11:15 KPMG
What I want to do is, when a project end time is entered search the
database for any other entries for that employee, on that day. Then,
compare the start time they have just entered, to the end time of the
last entry recorded. If the recently added time is less than the
previous end time, then we have an overlap and a message should be
displayed. If the start time is equal to, or greater than the previous
recorded end time, then all is OK.
I originally had code that performed a query on the database, in the
endtime_AfterUpdate event. This logic seemed to work fine, and the
checking of the time was OK. However, if the person recording time
above has really made a boo-boo, and should have entered the following:
Start End Description
09:00 10:00 PWHC Project
10:00 10:45 KPMG Project Briefing
10:45 11:15 KPMG
The code failed. As it was taking the newly entered start time as
10:00, it was comparing this to 11:15. As it is less than the previous
end time, it was showing an error. However, the times are actually
correct.
So, what's the best place to check the times, and how? Is it in the
AfterUpdate or in a Save? Should I proceed forward through the records
and then display the first incorrect entry?
TIA
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.
To e-mail, please remove NO_SPAM.
just can't seem to get a grip on.
Staff record their hours of work in an Access database, which helps to
detail what they have been working on, and how much should be billed to
the customer.
I have noticed however, that due to human error or whatever, some times
have been recorded incorrectly. For example:
Start End Description
09:00 11:00 PWHC Project
10:45 11:15 KPMG
Whilst the above times are indeed credible--i.e. an employee could be
working on two things at once, and is waiting for something to
finish--it's just not how we work. We have to end one project, before
starting work on another. So, a correct entry for the above, could be:
Start End Description
09:00 11:00 PWHC Project
11:00 11:15 KPMG
What I want to do is, when a project end time is entered search the
database for any other entries for that employee, on that day. Then,
compare the start time they have just entered, to the end time of the
last entry recorded. If the recently added time is less than the
previous end time, then we have an overlap and a message should be
displayed. If the start time is equal to, or greater than the previous
recorded end time, then all is OK.
I originally had code that performed a query on the database, in the
endtime_AfterUpdate event. This logic seemed to work fine, and the
checking of the time was OK. However, if the person recording time
above has really made a boo-boo, and should have entered the following:
Start End Description
09:00 10:00 PWHC Project
10:00 10:45 KPMG Project Briefing
10:45 11:15 KPMG
The code failed. As it was taking the newly entered start time as
10:00, it was comparing this to 11:15. As it is less than the previous
end time, it was showing an error. However, the times are actually
correct.
So, what's the best place to check the times, and how? Is it in the
AfterUpdate or in a Save? Should I proceed forward through the records
and then display the first incorrect entry?
TIA
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.
To e-mail, please remove NO_SPAM.