Schedule one shift in two dates

  • Thread starter Thread starter eb1mom
  • Start date Start date
E

eb1mom

I downloaded Duane Hookums' Recurring database and found it
a very useful tool for learning how to properly create a
schedule database. It works fantastic if all start-end
times are within one day. I am still having a brain freeze
about how to create schedule if start time is 11pm Friday
and end time is 7am Saturday. I searched database for
overnight scheduling and 24 hour scheduling but, didn't
find any articles. Any suggestions on where to find
information about creating this type of schedule database?
 
Could you change the code to use a start time and number of hours or minutes
duration rather than end time.
 
In my application, I use a form where a shift is selected
and and as a result a default start time is entered. You
have the option to accept or adjust the start time. After
entering the end-time, the gross hours field is calculated
using the following code:
Private Sub GrossHrs_Enter()

Dim Shift As Integer

Shift = Forms![Production]![Shift]

Select Case Shift
Case 1
GrossHrs = ((Hour(TimeOut) + (Minute(TimeOut) / 60))) -
((Hour(TimeIn) + (Minute(TimeIn) / 60)))

Case 2
GrossHrs = ((Hour(TimeOut) + (Minute(TimeOut) / 60))) -
((Hour(TimeIn) + (Minute(TimeIn) / 60)))

Case 3
If Hour(TimeIn) = 23 And Hour(TimeOut) <> 23
Then 'Clock In Berore Midnight and ClockOut After midnight
GrossHrs = 24 - Hour(TimeIn) - (Minute(TimeIn) /
60) + Hour(TimeOut) + (Minute(TimeOut) / 60)
Else
GrossHrs = ((Hour(TimeOut) + (Minute(TimeOut) /
60))) - ((Hour(TimeIn) + (Minute(TimeIn) / 60)))
End If
End Select
End Sub
 
Thanks for your suggestions. I will do some experimenting
with code and see if I can find a working solution.
 
Back
Top