This Might be very difficult (1 Viewer)

burton

Registered User.
Local time
Today, 10:09
Joined
Nov 15, 2002
Messages
63
i need to have a roster for my staff.

i have included the fields.

employee id
max hours week
monday morning
Monday evening
Tues morn
tues night
wed morn
wed night
thurs morn
thurs night
friday morn
friday night
sat morn
sat night
hours a week



how could i calculate how many hours somebody is working a week?
 

Tay

likes garlic
Local time
Today, 10:09
Joined
May 24, 2002
Messages
269
What are the fields in your list? Text? Number?
You could have the fields set to number (actually, date/time is probably what you want - dir), and have input masks for each day period on your entry form eg, Monday morning - 00:00 to 11:59 Monday night 12:00 to 23:59. Then you will keep the work periods separate (morning and night rather than the whole day - if this is what you need), and you should then be able to calculate the amount of time someone has worked in that period and add them all together to get a weekly total.

Where do you want the result to appear? On the form, in a report? It isn't good practice to store the results of calculations, but I'm guessing you will want to in this case.
 

burton

Registered User.
Local time
Today, 10:09
Joined
Nov 15, 2002
Messages
63
what would i start off with?

i have enterd the data into a table.
all of this is in a table at the moment.

monday start
monday finish
monday hours

and at the end i have hours worked.

how could i calculate hours worked?

could you tell me how to do it please. im in desperate need of help.
 

Tay

likes garlic
Local time
Today, 10:09
Joined
May 24, 2002
Messages
269
OK

Create a form (you can use the wizard)

Put your fields on there

monday start
monday finish

Call them txtMondayStart and txtMonday Finish

In Properties make sure these are set to a time format.

Add an unbound text box call it txtMondayHours

Make sure the format for this is set to time (short - or whatever you want)

On the After Update event in Properties for the textbox txtMondayFinish add this code.

Private Sub txtMondayFinish_AfterUpdate()
Me.txtHours = Me.txtMondayFinish - Me.txtMondayStart
End Sub

And you should then get the amount of hours worked.
Any more questions, post back.

HTH
 
R

Rich

Guest
You have a design problem with this structure, you only need one field to store the shift, try searching here for help on normalising your db.
 

Users who are viewing this thread

Top Bottom