Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I add a day to my date? 1

Status
Not open for further replies.

Chavito21

Programmer
Mar 26, 2003
230
0
0
US
Hi everyone,


I have this code:

Vardt = Date
MsgBox (Now)
MsgBox ("Use CTRL+BREAK to terminate manually.")
On Error Resume Next



Do
DoEvents
Loop Until Now > CVDate(Vardt & " 2:00:00 AM")


I want to add one day to my Date. I use this code to run and update but I want to click and run this proc tomorrow at 2 in the morning.
How can I do that?

thanks,
chavito
 
Hi,

Try this:

Vardt = DateAdd("d", 1, date)

Regards

Bill
 
Chavito21 (Programmer)

If you want to run this at two in the morning automatically, Are you planning on leaving the applicaiton running all night. I would suggest using the scheduler in the Windows environment to open your app at 2am and have the app set to run it's code and close. Just an idea.

Urbane Rove
 
Hi,

Any reason why you can't use:

Vardt = Date + 1

?

Adding 1 to a date defaults to 1 day does it not?


Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top