what method to use to add 1 day to a date (hotel reservation for one night by clicking on calender)

  • Thread starter Thread starter Amanda
  • Start date Start date
A

Amanda

here is my code; see ????


Private Sub dtmMonthCalendar1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles dtmMonthCalendar1.MouseLeave

mdatArrivalDate = dtmMonthCalendar1.SelectionStart
txtArrivalDate.Text = mdatArrivalDate

If dtmMonthCalendar1.CanSelect Then
txtDepartureDate.Text = dtmMonthCalendar1.SelectionEnd
txtNightStayed.Text = (dtmMonthCalendar1.SelectionEnd _
- dtmMonthCalendar1.SelectionStart).TotalDays
Else
txtDepartureDate.Text = ????
txtNightStayed.Text = "1"
End If '

mshrNightStayed = Val(txtNightStayed.Text)
dtmMonthCalendar1.Hide()

End Sub
 
Cor said:
Amanda,

By instance
mdatArrivalDate = mdatArrivalDate.AddDays(1)

Yeah, I needed to assign to a date variable and then call AddDays. I
was hoping that I could just do it diretcly to calender.SelectionEnd.

Thanks
 
Back
Top