DataRepeater Question

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.
 
K

Kerry Moorman

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
 
T

Tony K

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top