DataRepeater Question

  • Thread starter Thread starter Tony K
  • Start date Start date
T

Tony K

I downloaded the new VB PowerPack 3.0 and began using the DataRepeater. I
have 2 DateTimePickers, current and future. When I add a new item, to the
datarepeater, I want to automatically add 1 year to the future
DateTimePicker.

The DataRepeater contains fields from the Service table of my DataSet.

Here is my code.
Try
Me.DataRepeater1.AddNew()
Me.ServiceDateDateTimePicker.Value = Date.Today
Me.DueDateDateTimePicker.Value.AddYears(1)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try

I don't receive an exception, but the DueDate.... does not change. It
remains the same (today's date) as the ServiceDate....

Tony K.
 
Tony,

DateTime's AddYears method returns a datetime with the added value.

You could then, for example, assign the returned datetime to the
datetimepicker's value property, etc.

Kerry Moorman
 
Ohhh.. Ok. I'll try that.
Thanks,
Tony K.


Kerry Moorman said:
Tony,

DateTime's AddYears method returns a datetime with the added value.

You could then, for example, assign the returned datetime to the
datetimepicker's value property, etc.

Kerry Moorman
 
Back
Top