A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do I create warning box if hours are under or over



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2008, 07:31 AM posted to microsoft.public.access.tablesdbdesign
Gunther Dawson[_2_]
external usenet poster
 
Posts: 4
Default 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  
Old February 21st, 2008, 07:50 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.