Convert Access Query to .csv file

dcliffo

Board Regular
Joined
Jun 18, 2003
Messages
148
I would like to assign a macro to a command button that will automatically convert an Access query file to a .csv file. Too bad Access doesn't have a "record macro" feature like Excel and this would be a piece of cake!

Can anyone help me? :rolleyes:
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Use the TransferText method.

You'll need to create an import specification.

Just run through a text export from the File menu and set the appropriate values, click advanced and save "CSV Specification"
 
Upvote 0
Thank you, but then how do I assign this to a command button or open it up the next time.

I'm old and a big dufus....
 
Upvote 0
I solved my problem! I also solved the problem of the date being exported with the seconds. By using a query and a calculated field for the date, you can suppress the seconds and put the date in any format that you need exported to the Excel file.

I also created a Macro by using the TransferText command and saving an export specification file as you had recommended. I added the command button onto my form and it works perfectly. When you open the .csv file in Excel, all of the exported fields show up correctly...even the date.

Thanks for the help in getting my brain to work!!!
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,325
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top