[RESOLVED] add one month to a datepicker
i have a form in visual basic 2010
it contains 2 datepicker
the first one is the recharge date so i will choose the date
the second one is the expiry date so it will add automatically one month
(seconddatepicker = firstdatepicker + one month)
in the previous version of my app it was maded in access 2013
i put in the textbox control source (=DateAdd("m";1;[txt_Recharge_Date]))
but i can't use it in vb
any help please ??
Re: add one month to a datepicker
Try this:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DateTimePicker2.Value = DateTimePicker1.Value.AddMonths(1)
End Sub
Re: add one month to a datepicker
thank you hamza it works fine
Re: [RESOLVED] add one month to a datepicker
i have a form in visual basic 2010 it contains 2 datepicker the first one is the recharge date so i will choose the date the second one is the expiry date so it will add automatically one month (seconddatepicker = firstdatepicker + text box value) it was not working in visual studio 2010 help me)