Solved

VBA Time Hour Mins Seconds

Posted on 2007-03-29
5
286 Views
Last Modified: 2013-11-27
The output below spceifies Month-day-year and -time hours- Mins. can I include seconds or tenths of seconds?

  sOutput = CurrentProject.Path & "qryReactorBatch_" & Format(Now(), "mm-dd-yyyy-hhmm") & ".xls"
0
Comment
Question by:jcuzzola
[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
  • 3
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18816236
Change to Format(Now(), "mm-dd-yyyy-hhmmss")
to get seconds
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 125 total points
ID: 18816245
 sOutput = CurrentProject.Path & "qryReactorBatch_" & Format(Now(), "mm-dd-yyyy-hhmmssms") & ".xls"
will give you milliseconds
0
 

Author Comment

by:jcuzzola
ID: 18816958
Thanks sir bounty... Working well....
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18816980
:)
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 22970017
For the records: This doesn't work as advertised, as VBA doesn't know of milliseconds natively.

However, it can be done. Follow the link here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_23725904.html

/gustav
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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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