-
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....
-
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