How to compare two DateTimePicker's values and change the 1st DateTimePicker's value to that of the 2nd

4.4k Views Asked by At

i've been searching the net for ideas as to how to be able to do this and so far, i haven't got anything.

this is my code so far...

If dtp_warrantyExp.Value.Date > dtp_dateAcquired.Value.Date Then
        dtp_warrantyExp.Value = dtp_dateAcquired.Value
    End If
1

There are 1 best solutions below

2
On

You are not too far from the correct code. Here goes...

If dtp_warrantyExp.Value.Date > dtp_dateAcquired.Value.Date Then
        dtp_warrantyExp.Value = dtp_dateAcquired.Value.Date
End If