473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help Please!!

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
3 1629
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
1
by: LilleSkutt | last post by:
I am trying to create and instantiate a class into a created domain, so that I can unload the domain and replace the class (assembly .dll) while the main application is running, but I can't get it to...
14
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would like to have happened is this: 1) On the Left...
3
by: radioman | last post by:
Hi all, I would appreciate some help please. I just need pointing in the right direction as I am at a loss. Basically I have a form (frmAddMaster) which displays two subforms "Master Stock...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
1
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this....
4
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this...
28
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is supposed to figure out which handlers to invoke when...
2
by: Richard | last post by:
Help please. I am trying to autofill a form text field from a select-box lookup. I have no problem doing this if the select-box is part of the form but because there are 5 possible select boxes...
0
by: uno7031 | last post by:
Help Please!!! Adding 5 Days to another Date in an access query Good Morning, Help please…. I am new to access and trying to write a query that will add 5 days between a RecDate and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.