I have two text boxes side by side. The user enters in a date in the first box in ##/##/## format. When they tab to the next box I would like it to autopopulate with a date 365 calender days from the first box..Any help would be awesome.>Thanks
Adam
Printable View
I have two text boxes side by side. The user enters in a date in the first box in ##/##/## format. When they tab to the next box I would like it to autopopulate with a date 365 calender days from the first box..Any help would be awesome.>Thanks
Adam
if you have VB6 then use the DTPicker- control or the MonthView control from the Microsoft Windows Common Controls-2 6.0
Give this a try:
Hope this helps.Code:
Private Sub Command1_Click()
myDate = CDate(Text1.Text)
Text2.Text = DateAdd("d", 365, myDate)
End Sub
reeset, two things:
1) thank you for showing me a new function! never knew about the DateAdd
2) it should actually read
you have the number 365, and that makes it show a value of exactly one year minus one day ahead of the passed value.Code:Text2.Text = DateAdd("d", 366, myDate)
will it matter if the text boxes are masked edit boxes??
Yeah its not working I think because they are masked edit boxes with a mask of ##/##/## anymore help please????