coudl you help me adding the date
if i have 10/05/2009 add one day
shows 10/06/2009
Printable View
coudl you help me adding the date
if i have 10/05/2009 add one day
shows 10/06/2009
Simple method
Code:Private Sub Form_Load()
Dim dt As Date
dt = "10/05/2009"
MsgBox (dt + 1)
End Sub
That code is valid, but needs a simple correction:
..without that change, the value may be Oct 5th or May 10th, depending on things outside of your control. For more information, see the article Why are my dates not working properly? from our Classic VB FAQs (in the FAQ forum)Code:dt = #10/05/2009#
An alternative to the +1 method is to use the DateAdd function, eg:
In terms of adding days this takes more code, but for other things (like months or hours) it is the simplest solution.Code:MsgBox DateAdd("d", 1, dt)