Simple DateTimePicker question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brett Baisley

    #1

    Simple DateTimePicker question

    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?


  • Herfried K. Wagner [MVP]

    #2
    Re: Simple DateTimePicker question

    * "Brett Baisley" <bbaisley@nbnet .nb.ca.REMOVE> scripsit:[color=blue]
    > 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[/color]

    \\\
    DateOut.Value = DateIn.Value.Ad dDays(2)
    ///

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

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

    Comment

    Working...