By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,163 Members | 934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,163 IT Pros & Developers. It's quick & easy.

Help Please!!

P: n/a
HI all!!

Does anybody knows a function that will allow me to do the following
in a form:

StartTime StopTime TotalHours NO LUNCH(this is a Check Box)
8:00 03:00pm 07:00

The Problem is that if the employee check "NO LUNCH"; 30 minutes has
to be add it to Total Hours. In this case, if the employee check "NO
LUNCH" total hours will be 07:30. It seems very simple, but I don't
have any experience in Access2000. Also, If there is any function,
does the function will go into the click event or Afterupdate event???
Here is the Data/type of those fields?
startTime= Date/time
StopTime= Date/time
TotalHours= text
NOLUNCH= Yes/NO

Thanks in advanced.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 13 Apr 2004 06:40:20 -0700, christian wrote:
HI all!!

Does anybody knows a function that will allow me to do the following
in a form:

StartTime StopTime TotalHours NO LUNCH(this is a Check Box)
8:00 03:00pm 07:00

The Problem is that if the employee check "NO LUNCH"; 30 minutes has
to be add it to Total Hours. In this case, if the employee check "NO
LUNCH" total hours will be 07:30. It seems very simple, but I don't
have any experience in Access2000. Also, If there is any function,
does the function will go into the click event or Afterupdate event???

Here is the Data/type of those fields?
startTime= Date/time
StopTime= Date/time
TotalHours= text
NOLUNCH= Yes/NO

Thanks in advanced.


In a query:
TotalHours:
DateDiff("n",[StartTime],DateAdd("n",Abs([Check])*30,[EndTime]))/60

In an unbound control's Control Source:
=DateDiff("n",[StartTime],DateAdd("n",Abs([Check])*30,[EndTime]))/60

Because a Yes/No field value is either -1 or 0, you can add either 0
or 30 minutes to the EndTime and divide by 60 minutes to get the
result in hours. The ABS() function makes the number a positive value.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2

P: n/a
Thanks Fred for your reply. The function works, but it alters the
functionality of the other fields.I get this in my totalHours field
#NAME?

Do you have any other suggestions??

Thanks,once again.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
cristian sepulveda wrote:
Thanks Fred for your reply. The function works, but it alters the
functionality of the other fields.I get this in my totalHours field
#NAME?

Do you have any other suggestions??

Thanks,once again.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Change his Check to NoLunch.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.