Results 1 to 3 of 3
  1. #1
    rickn is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    7

    Calendar with Selection of NON Work Dates


    Is there a way to have a calender show and be able to select the dates on the calendar as non work dates? For example, if a job is scheduled to start on Friday and takes 2 days to complete, it realy won't be done untill Monday - since Sat and Sun are non work days.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    This is what I have done:
    1) Type starting date
    2) Type no.of.Days required to complete the job.
    3) the ending date is Calculated when Calculate date button is Clicked.

    The calculation excludes the week ends. test the set up and see.

    Code used:

    Private Sub Command4_Click()
    On Error GoTo Err_Command4_Click
    Dim dtFinishingDate As Date
    Dim intfinishingDay As Integer
    Dim dtfinalFinishingDate As Date
    Dim intDays As Integer
    Dim intSunday As Integer
    Dim intSaturday As Integer
    Dim intCounter As Integer

    intSunday = 0
    intSaturday = 0
    intCounter = 0

    For intCounter = 0 To Me.Text2 - 1
    dtFinishingDate = DateAdd("d", intCounter, Me.Text0)
    intfinishingDay = DatePart("w", dtFinishingDate)
    Select Case intfinishingDay
    Case Is = 1
    intSunday = intSunday + 1
    Case Is = 7
    intSaturday = intSaturday + 1
    End Select
    Next

    intDays = (intSunday + intSaturday + Me.Text2) - 1
    dtfinalFinishingDate = DateAdd("d", intDays, Me.Text0)

    Select Case DatePart("w", dtfinalFinishingDate)
    Case Is = 7
    Me.Text5 = DateAdd("d", 2, dtfinalFinishingDate)
    Case Is = 1
    Me.Text5 = DateAdd("d", 1, dtfinalFinishingDate)
    Case Else
    Me.Text5 = dtfinalFinishingDate
    End Select



    Exit_Command4_Click:
    Exit Sub

    Err_Command4_Click:
    MsgBox Err.Description
    Resume Exit_Command4_Click

    End Sub

    Please refer the attached db.

  3. #3
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    is you problem solved if yes mark this thread solved.

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

Similar Threads

  1. Event Calendar Help
    By Nosaj08 in forum Forms
    Replies: 9
    Last Post: 06-11-2010, 11:19 AM
  2. Help with Calendar
    By alanl in forum Access
    Replies: 1
    Last Post: 03-15-2010, 08:16 AM
  3. Subform Selection
    By doug adams in forum Forms
    Replies: 2
    Last Post: 06-28-2009, 10:27 PM
  4. Data selection
    By cesander in forum Forms
    Replies: 0
    Last Post: 09-18-2008, 02:24 PM
  5. Calendar Mystery
    By BankWalker in forum Forms
    Replies: 0
    Last Post: 02-16-2006, 01:29 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