Results 1 to 2 of 2

Thread: time range

  1. #1
    Join Date
    Dec 2002
    Posts
    31

    Question Unanswered: time range

    Dear All,
    I have two feilds the first is a time field short time representin the start time of an event in 24 hr format and another fileld shows the name of the shift in which this event had happened, e.g :
    start time = 22:00 the shift field = "Night shift"
    start time = 06:00 the shift field = "OverNight shift"
    start time = 09:00 the shift field = "Morning shift"
    I want to set a range for each shift 08:00 to 14:00 ---> Morning
    14:01 to 22:00 ----> Night And 00:01 to 07:59----> overNight
    I want to setthe value of the shift to the corresponding right valuer when i enter the start time
    How I ccan make this?

  2. #2
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Private Sub Shift_AfterUpdate()
    Dim TimeShift As Date
    TimeShift = Me.TimeUsed
    If TimeShift >= #8:00:00 AM# And TimeShift < #2:01:00 PM# Then
    Me.Shift1 = "Morning"
    ElseIf TimeShift >= #2:01:00 PM# And TimeShift < #10:01:00 PM# Then
    Me.Shift1 = "Night"
    ElseIf TimeShift >= #10:01:00 PM# And TimeShift <= #11:59:59 PM# Or TimeShift >= #12:00:00 AM# And TimeShift < #8:00:00 AM# Then
    Me.Shift1 = "overNight"
    End If
    End Sub

    me.TimeUsed is textbox your filling in the time and Me.shift is the outcome of the type of shift.
    Last edited by DeathWing; 12-18-02 at 10:54.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •