Chris Pfeiffer
asked on
Add Date
I know that this is an easy question but I just am drawing a blank right now so I have come to you...
I want to calculate many dates from a date picked from a DateTimePicker. The problem is I want it to only make the fisrt calculation off of the DTP.
See Code
Then I want another txtbox to display to show the result of 10 more months from the date in txtE3. The thing is that the value of the text box is a string and you can not use the AddMonth to it. I though that i could just keep reusing _date with the next value but I was doing something wrong. To tired right now i guess..
Thanks
I want to calculate many dates from a date picked from a DateTimePicker. The problem is I want it to only make the fisrt calculation off of the DTP.
See Code
Then I want another txtbox to display to show the result of 10 more months from the date in txtE3. The thing is that the value of the text box is a string and you can not use the AddMonth to it. I though that i could just keep reusing _date with the next value but I was doing something wrong. To tired right now i guess..
Thanks
Dim _Date as Date
_date = dtpstart.Value.Date
txtE2.Text = _date.AddMonths(6)
txtE3.Text = (the result from above then add 10 months)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OR you can do this.........
Private Sub dtpstart_ValueChanged(ByVa l sender As Object, ByVal e As System.EventArgs) Handles dtpstart.ValueChanged
Me.TextBox2.Text = dtpstart.Value.Date.AddMon ths(6)
Me.TextBox3.Text = CType(TextBox2.Text, Date).AddMonths(10)
End Sub
Private Sub dtpstart_ValueChanged(ByVa
Me.TextBox2.Text = dtpstart.Value.Date.AddMon
Me.TextBox3.Text = CType(TextBox2.Text, Date).AddMonths(10)
End Sub
Try this..
TextBox1.Text = DateAdd(DateInterval.Month , 10, Now)
Regards,
M.Raja
TextBox1.Text = DateAdd(DateInterval.Month
Regards,
M.Raja
txtE3.Text = _date.AddMonths(16)