Solved

returning a date equal to tomorrows date at a certain time

Posted on 2002-04-17
1
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

615 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