Simple DateTimePicker question

B

Brett Baisley

Hello

I am using two datetimepicker controls to allow the user to select two
dates. I've called them dateIn and dateOut. After they pick the dateIn, I
want to set its Leave method to automatically set the date of dateOut to
whatever was selected in dateIn + 2 days (as this will be the most common
selection for the second date).

I tried this:
dateOut.value = dateIn.value + 2

But I get an error saying I can't add date's and doubles.

Is there a way to increment the date by 2?
 
H

Herfried K. Wagner [MVP]

* "Brett Baisley said:
I am using two datetimepicker controls to allow the user to select two
dates. I've called them dateIn and dateOut. After they pick the dateIn, I
want to set its Leave method to automatically set the date of dateOut to
whatever was selected in dateIn + 2 days (as this will be the most common
selection for the second date).

I tried this:
dateOut.value = dateIn.value + 2

\\\
DateOut.Value = DateIn.Value.AddDays(2)
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 

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

Similar Threads


Top