Results 1 to 4 of 4
  1. #1
    boywonder381's Avatar
    boywonder381 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    28

    Trying not to Schedule Classes around Lunch Time

    I'm trying not to schedule courses around lunch time, but the following code I use will not schedule untill the LunchEnd time:

    If TimeBeg >= rsShifts!LunchBegin And CDuration <= rsShifts!LunchEnd Then


    TimeBeg = rsShifts!LunchEnd
    End If

    If TimeBeg >= rsShifts!LunchBegin And CDuration >= rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If

    If TimeBeg <= rsShifts!LunchBegin And CDuration >= rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If

    If TimeBeg <= rsShifts!LunchBegin And CDuration <= rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If

    I started with the first If, End If statement and it helped by not scheduling classes if the TimeBeg was greater than the LunchBegin. But I still had problems with if a class was scheduled before LunchBegin and the CDuration, which is the end of the class was schedule in between the Lunch Time.

    Could anyone help pleasssseeeee...

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    see this for help

  3. #3
    boywonder381's Avatar
    boywonder381 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    28
    Thanks Orange... Your solution is to grab records within a time range and place them in a recordset. I want to grab these records and give them a new start time which would be the end of the lunch period. I tried your scenario, but it still was grabbing records within the lunch time range.

    Click image for larger version. 

Name:	classroom2.jpg 
Views:	9 
Size:	81.2 KB 
ID:	18101
    Attached Thumbnails Attached Thumbnails classroom.jpg  

  4. #4
    boywonder381's Avatar
    boywonder381 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    28
    Orange, I looked at your diagram again and wrote the following code:

    If TimeBeg <= rsShifts!LunchBegin And CDuration <= rsShifts!LunchEnd Then
    If CDuration > rsShifts!LunchBegin Then
    TimeBeg = rsShifts!LunchEnd
    End If
    End If

    If TimeBeg >= rsShifts!LunchBegin And CDuration <= rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If

    If TimeBeg >= rsShifts!LunchBegin And CDuration >= rsShifts!LunchEnd Then
    If TimeBeg < rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If
    End If

    If TimeBeg <= rsShifts!LunchBegin And CDuration >= rsShifts!LunchEnd Then
    TimeBeg = rsShifts!LunchEnd
    End If

    - - - - - - - - - - -

    It worked like a champ... Thanks alot Orange.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help a newbie keep track of lunch money
    By ericturnerpd in forum Access
    Replies: 15
    Last Post: 02-25-2014, 01:27 AM
  2. Classes not taken
    By sdc1234 in forum Queries
    Replies: 1
    Last Post: 02-20-2014, 02:16 PM
  3. Replies: 0
    Last Post: 01-30-2012, 01:14 PM
  4. what does this mean: [classes]![cDate]
    By rankhornjp in forum Programming
    Replies: 6
    Last Post: 11-09-2011, 02:37 PM
  5. Time Schedule display in access
    By snoopy2003 in forum Database Design
    Replies: 3
    Last Post: 03-23-2011, 04:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums