Solved

MS Access Macro with timestamp on filename

Posted on 2013-05-30
2
850 Views
Last Modified: 2013-06-21
I have a macro on MS Access 2007 that outputs to a file name....I receive an error when I try to add the timestamp to the file name.
 MS Access cant save the output data to the file you selected


Outputto    "P:\MAK Setup and documentation\MAK Reports\UDA_MAK\prn_pain\hlw_" & Format(Now(), "yyyymmddHHnnss") & ".xls"
0
Comment
Question by:hwassinger
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39207761
you can not use a variable inside the macro command..

use a vba function and call the function in your macro with

RunCode



Function Name  YourFunctionName()



create a  function in a Regular module

Function YourFunctionName()
' your export code here

End function
0
 

Author Comment

by:hwassinger
ID: 39207765
That would require a new vba code for each and every report that has a different name then?

Ive done this before I believe
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 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