I have made a small programme to get the retirement date when we give the date of birth.In our institution the retirement date is the last date of the month when he completes 60 years.Even though my code works it is not the way I expected.In my form there are 3 date text boxes Which I formated at the design time: dd-mm-yyyy When we put dob in the first and click the cmd(eg: 18-12-2000)the second box shows the date after 60yrs,but in the format mm/dd/yyyy ie.12/18/2060 and the third box shows 12/31/2060
I want all the date format like dd-mm-yyyy Please any one help me.
My code goes like this
Code:
Private Sub CmndClick_Click()
Dob = TxtDate.Text
Rtddt = DateAdd("yyyy", 60, Dob)
Txt1 = Rtddt
Txt2 = GetMonthEnd(Rtddt)
End Sub
Private Function GetMonthEnd(ByVal Rtddt As Date)
GetMonthEnd = DateAdd("d", -1, DateAdd("m", 1, ((Format$(Rtddt, "mm") & "/01/" & Format$(Rtddt, "yyyy")))))
End Function