Is there a VBA to run all my saved exports when database is opened.
Is there a VBA to run all my saved exports when database is opened.
Probably a pivot will help posting a sample will help
☚ Click ★ just below left if it helps, Boo?ath?
Sorry posted in wrong thread
It will have to be written specifically for your database. There is no generic code to do this.
You would put the code in the OnOpen Event for a particular Form (probably the one that opens automatically) using the DoCmd.TransferSpreadsheet function for each query to export, listing them one after the other in your code.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
I am new to this can you send me a sample to work from.
See the attached.
So i used your code and can't get it to work. I think part of the issue is i am trying to export tables not queries.
Should not make a difference, change up the document to be exported to the table name. Look at the code for this file. I changed the document to be exported to be the tables and not the queries.
do i need to change the name and owner for this to run on my data base?
If you are running Win 7 or Win 8, you should not have to change the owner. This has been set to the name of the user on the machine you are using. I prefer to do it this way rather than hard code the user. If you want to understand this a little better, then look at this link on the Environ function.
http://www.myengineeringworld.net/20...variables.html
Last edited by alansidman; 11-13-2014 at 07:50 PM.
Here is my code coverted for me and I can't get it to work.
HTML Code:
I can see nothing wrong with your code. Are you getting an error message? The files are not in the directory specified by the path?
BTW: Since you are not exporting to the desktop, you do not need to define the owner nor set the variable. It is extraneous and can either be commented out or deleted.
Also the message is telling you to look on your desktop but you are directing the tables to a directory in the U drive.
They are not there. and when the compile check i got no errors.
At this point without actually viewing your db, I don't know what to tell you. When you opened my db, did the two tables appear on your desktop?
yes sir. I will try and make it small enough to attach.
sadly the system won't allow me to attach a database.
You will need to zip the file. You cannot upload a Access file directly. It must be in a zip file.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks