MIchael,
You should be able to set the Value of your Time picker to the Date of the
Date picker & the Time of the Time picker, when the Date picker's value
changes.
Something like:
Private Sub pickerDate_Valu eChanged(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles pickerDate.Valu eChanged
pickerTime.Valu e =
pickerDate.Valu e.Date.Add(pick erTime.Value.Ti meOfDay)
End Sub
Private Sub pickerTime_Valu eChanged(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles pickerTime.Valu eChanged
Me.labelDateTim e.Text = pickerTime.Valu e.ToString()
End Sub
Where pickerDate is a DateTimePicker for the Date value & pickerTime is a
DateTimePicker for the Time value.
I would consider encapsulating both controls into a new User Control to
allow easier reuse & better encapsulation.. .
Hope this helps
Jay
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:ut******** ******@TK2MSFTN GP10.phx.gbl...
Hi Guys
I have two DateTime pickers one shows the Date and the other the time,
this is a requirement of the solution. The problem I have is that when the
time is saved to the sql database into a datetime field it uses the
default date which is a problem when I try to sort, what I wanted to know
is there a way for me to set the date in the time picker to the date in
the date picker?
Any help greatly appreciated.
Thanks
Mike