Solved

returning a date equal to tomorrows date at a certain time

Posted on 2002-04-17
1
171 Views
Last Modified: 2010-05-02
What is the smartest way or getting the value of the date and time for tomorrow at 5pm
 
Dim x
x = Now + 1
returns tomorrows date
But I also want to set the time part of the value to 5pm ?

Any help appreciated
Paul
0
Comment
Question by:skintpaul
1 Comment
 
LVL 18

Accepted Solution

by:
mdougan earned 50 total points
ID: 6947623
I'm surprised that Now + 1 works.  Normally, this is how I'd code that:

Private Sub Command1_Click()
Dim x As Variant

x = CDate(Format(DateAdd("d", 1, Now()), "mm/dd/yyyy") & " 05:00:00 PM")
Me.Print x
End Sub
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question