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
|
|||
|
|||
how do I create warning box if hours are under or over
Time heet - how do I calculate hours worked and overtime with a must of 40
hours before overtime can be added. |
#2
|
|||
|
|||
how do I create warning box if hours are under or over
It would be possible to use the BeforeUpdate event procedure of the record
to DSum() the hours for the employee in the week from the records other than this one, add the hours in this one, see if it comes to 40 (possibly allowing for floating point inaccuracy), and cancel the event if there's not enough. Before you do that though, you might like to consider whether blocking like that is what you need. It would assume that data entry is always being made in the correct order. For example, if the data entry person is trying to put in a claim for 2 hours overtime on Friday, but Thursday's timesheets have been delayed and she has not received them yet, you will be actually blocking her from entering valid data. It might be better to use something like Conditional Formatting to flag the control with a red background if the hours are not up to 40 yet, rather than to block the entry. Alternatively, you might design an interface where the user enters the number of hours into an unbound box, and you programmatically break it down into normal hours and overtime. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Gunther Dawson" wrote in message ... Time heet - how do I calculate hours worked and overtime with a must of 40 hours before overtime can be added. |
Thread Tools | |
Display Modes | |
|
|