Solved

VBA Time Hour Mins Seconds

Posted on 2007-03-29
5
274 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
  • 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 49

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now