473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Outputto Macro

22
I want to be able to export a query, in which a folder s created and the file is named based on two fileds of the query. I found the MAcro Outputto, but in order to use it you need to say exactly the path and name of the file.

I need for example: export query which has as parameters the variable names AMP_ID and Start Date with values 10111 and 1/1/2008, respectivley to be saved in C:\Myfiles\2008-01\10111\AMP_200801_10111.xls

If I have another query with parameters AMP_ID=10201 and Start Date=1/1/2008 to be saved in C:\Myfiles\2008-01\10201\AMP_200801_10201.xls
Jun 10 '08 #1
1 1456
puppydogbuddy
1,923 Expert 1GB
Try this. Keep in mind that the start date has to be formatted as a string without slashes or hyphens in order to be legal within a file name.


DoCmd.OutputTo acOutputReport, "YourAccessReportName", acFormatXLS,
"C:\Myfiles\" & AMP_ID & "\" & Format([Start Date], "mmddyyyy") & ".xls", False
Jun 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pete L. | last post by:
I created a macro with two instructions: (1) SetWarnings = No (2) OutputTo ... <file name> My problem is that I will run a batch of these macros and do not want my users to get prompted every...
1
by: paul.hanti | last post by:
This board has been a plethora of information. Thanks to all that respond! I have a quick question regarding the built-in OutputTo macro. I've built a shared database in Access 2003 (in Access...
4
by: tmountjr | last post by:
I've got a user who's trying to export a text file with unicode formatting. When he exports it as straight ascii, some of the foreign characters (mostly just accent marks and the like - no...
3
by: kscheu via AccessMonster.com | last post by:
I am using OutputTo to export a query to excel, prompt the user to save as and then open the excel file. See below: DoCmd.OutputTo acOutputQuery, "q701ExportFields", acFormatXLS, , True 'Opend...
5
by: dancole42 | last post by:
I have a question regarding the DoCmd.OutputTo function. I have an invoice report that shows all of the invoices for a particular date. I want to create a button that will export each page of...
2
by: RZ15 | last post by:
Hi, I'm using MS Access 2000. I have a button that does this: DoCmd.RunMacro "ExportSomeQuery" the macro uses the OutputTo command to export the query into excel. I want it to export in MS...
3
by: RZ15 | last post by:
Hi, I'm going to be giving many people an access database file with a switchboard with quite a few essential queries (query-by-form) so that they can pull data whenever they want. I have a button...
3
benchpolo
by: benchpolo | last post by:
I wrote a funtion in VBA OutputTo an excel file using dynamic filename. Table: contact Filename format: contact_10292007.xls Code: Function outfile() Dim stbl As String stbl =...
2
by: jmartmem | last post by:
Greetings, I have several Access 2007 reports that I regularly export to individual PDF flat files on a web server. I've successfuly created a module sub to export the reports using the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.