473,324 Members | 2,531 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,324 software developers and data experts.

Create a field for every hour between Time In and Time Out

I have a database that I am using as a Time clock where employees can
clock in and out. Is there a way to make it so that when they clock
out a form would open displaying their work day hour by hour with combo
boxes next to each hour that they could select what task they did for
the coorisponding hour. For example: lets say the clock in field says
"7/5/2006 11:00:00 AM" and the clock out field is "7/5/2006 8:00:00
PM." Once they clock out a form opens that would look something like:
Employee Name
7/5/2006

11:00AM Combo box with list of possible tasks
12:00PM Combo box with list of possible tasks
1:00PM Combo box with list of possible tasks
2:00PM Combo box with list of possible tasks
.........................etc.
.........................etc.
8:00PM Combo box with list of possible tasks

I can build the form ok but I am unsure how to have this form populate
with combo boxes for only the hours worked or for multiple hours
period. Is this even possible?
Any insights or comments would be greatly appreciated.
Thanks

Jul 7 '06 #1
3 2156
I would envision two more tables besides the project and employee
table.

1) a table of std times with one for every timeperiod that you want to
have records for.
(A record for each hour from midnight through 11:00PM)

tblStdTimes
ID PK
StdHour date/time

2) Child table for an employee's time and project
tblWorkTimes
ID autonumber
EmployID PK FK employee owner for these tasks
WrkDate PK shortdate
WrkStdHour PK
WrkProjectID
other info as required

When the employee clocks out run an append query that creates
tblWrkTimes records for all records in the tblStdTimes between the
employee's start time and his clock out time. Then requery the subform
showing the newly created records. By having the emplyID and workdate
and stdHour as PK then you will not get duplicates but an employee can
change his clock out time from 3:00 to 4:00 and have one extra record
created. You will have to decide what to do if he needs to change it
back to 3:00 from 4:00 because you now have an extra record.

Use a parent child type subform to show his time records and he/she
fills out the rest of the info.

You may wish some checks and balances that all records are filled out,
no deletes? no adds?
OR

have the tblWorktimes to simply be
tblWorkTimes
ID autonumber
EmployID PK FK employee owner for these tasks
WrkDate PK shortdate
WrkMinutes number number of minutes (integer) worked on project
or
hours and decimal part of hour
(allow 2 decimal places)
WrkProjectID
other info as required

And allow adds and deletes, no need for stdhrs table, but add a test to
make sure there are sufficient minutes to go from start time thru end
time and no more than that. Decide what to do about lunch time. This
allows for fewer records and multiple hours of work. Whole day would
need only 2 records one for lunch and one for project.

Justs some thoughts to get the brain juices working.

Ron

Jul 7 '06 #2
Thanks for the idea. I think what you are suggesting would work but I
think I'm looking a little different. The employees are actually
teachers for dance classes and they teach a different class every hour.
They also have other tasks to do and their really isn't a set schedule
for each teacher. I know that sounds wierd but that is how it works.
Right now I have a list of classes and duties, a list of employees, and
a list used to track clock in and clock out time stamps. Now I think
what I need to do is create a code or a query of some sort (running
behind a form) that finds how many hours they have worked, and creates
a field for each hour worked. It would be ideal if these fields could
be combo boxes linked to the table of classes and duties so that they
could just find the duty they performed that hour instead of typing it
in manualy.

Jul 7 '06 #3
I'm reasonably certain you are proposing an "unnormalized" design which
will, with some certainty, cost you a significant amount of extra work, and
personal grief in the future, when you try to manipulate the table you
describe.

Almost certainly, the date-time-class information should be stored in a
table related one-to-many from the instructor table. Sooner or later, you
are going to want to query this information, and the structure you describe
will make that difficult.

Larry Linson
Microsoft Access MVP

"Shawn Yates" <sy****@cc.usu.eduwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Thanks for the idea. I think what you are suggesting would work but I
think I'm looking a little different. The employees are actually
teachers for dance classes and they teach a different class every hour.
They also have other tasks to do and their really isn't a set schedule
for each teacher. I know that sounds wierd but that is how it works.
Right now I have a list of classes and duties, a list of employees, and
a list used to track clock in and clock out time stamps. Now I think
what I need to do is create a code or a query of some sort (running
behind a form) that finds how many hours they have worked, and creates
a field for each hour worked. It would be ideal if these fields could
be combo boxes linked to the table of classes and duties so that they
could just find the duty they performed that hour instead of typing it
in manualy.

Jul 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
3
by: La di da Limey | last post by:
Hi, I have a field in a database called "Timestamp" which has the date and time of an event, for example: "01/02/2002 09:07:59" The format is MM/DD/YYYY HH:MM:SS I want to chop the field...
1
by: evilasukakitty | last post by:
I too am new to the whole C++ language, and I am an eager beaver and wish I could absorb it all instantly, but I can't. The first program I wrote (very simple) was easy enough, using your basic cin...
1
by: Steve Harp | last post by:
Hi All, I'm not sure this can be done in a calculated field but here's what I need. I have a table that stores time off for employees (such as vacation, sick time, etc). An employee can take...
0
by: BUZYbuz | last post by:
I have a .csv file with 5 fields. the fifth field have data that looks like 0002121925 where the first two digits stands '00' stands for ' Year which is 2007', next two digits '02' for month which...
2
by: dylanhughes | last post by:
I'm looking for an example of a login system that has multiple fields (2 to be exact) + password. e.g username, company name and password, the user, company and password are checked against a mysql...
4
by: jonceramic | last post by:
Hi guys, I have a user who wants to have a report that shows only the 10th value recorded by his equipment. (i.e. His equipment records temperature every 30 seconds, but he only wants to view...
5
by: hassanhundal007 | last post by:
In my table the field of DateTime name is TIN. In this field DATE and TIME are shown for date I pass this query: SELECT DAY(TIN) FROM SHIFT WHERE SHID = 1 Then the result is "10". So the same I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.