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
Solved

returning a date equal to tomorrows date at a certain time

Posted on 2002-04-17
1
175 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

839 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