Results 1 to 2 of 2

Thread: Calender Control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    17

    Calender Control

    I Have a calender control by using this i am displaying all the months...with this i have three text box's one is for To_date, Reply_In_Days, Expected_Reply_date....

    The Process is when i select To_date as 29/04/2011 and Reply_In_days as 2, then Expected_reply_Date will be 31/04/2011, but in the month of April we have only 30 Days, here Expected_Reply_Date should be 01/05/2011 but it is taking it as 31/04/2011....

    Please advice me how to solve this problem....


    Thanks In Advance....

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: Calender Control

    The DateAdd function is what you are looking for.
    Code:
    Private Sub Command1_Click()
    Dim To_Date As Date
    Dim Reply_In_days As Integer
    Dim Expected_reply_Date As Date
    
        To_Date = CDate("29/04/2011")
        Reply_In_days = 2
        
        Expected_reply_Date = DateAdd("d", Reply_In_days, To_Date)
        
        MsgBox Expected_reply_Date
    End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width