code to add 15 days to a given date.
M writing a program to display the date ie. 15 days later after a given (present/todays)date.
Wel its actually like this. As soon as i write todays date, in the next text box, the date shd be automatically displayed adding 15 days to the present date which is already displayed.
Eg. supose i enter 01/06/2008 (dd/mm/yyyy), it shud automatically display 15/06/2008.
M trying to use
Datediff() function, but i dont know how to go about.
can anyone plz help me with the code..?
chanthung
Junior Poster in Training
52 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
Thanks lots to all of u for help. M on it right away. Actually i'll be taking the date from the user tru da text box (n tn accept it in a string i suppose..)and try to add using the DateAdd function. The new date will be displayed in the next textbox. So after say 15 days it shud display a msg or change the background color i gs. M using Grid Control layout to display the Datas. MS Access is my database.
Have a Wonderful day ahead!!!!
chanthung
Junior Poster in Training
52 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
made it this way.
Private Sub Text5_Lostfocus()
Dim PDate, RDate As Date
PDate = CDate(Text5.Text)
RDate = DateAdd("d", 15, PDate)
Text6.Text = RDate
End Sub
chanthung
Junior Poster in Training
52 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0