Exporting a table to CSV

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
A

Anthony Viscomi

I am trying to export a table to a csv file. I would like to do this via
code. I read the Help, but I am somewhat confused about the arguments that
are need to perform this action.
Thanks,
Anthony
 
This might help:

DoCmd.TransferText acExportDelim, strSpecName, strTableName,
Me![txtLocalDir] & Me![txtLocalFileName], True
 
Use the DoCmd.TransferText action in VBA to do this. What specific questions
do you have about it?
 
For the argument of strSpecName, how to make that if I
would like to have Tab for the delimiter?

Thanks in advence.
-----Original Message-----
This might help:

DoCmd.TransferText acExportDelim, strSpecName, strTableName,
Me![txtLocalDir] & Me![txtLocalFileName], True
--
Joe Fallon
Access MVP



I am trying to export a table to a csv file. I would like to do this via
code. I read the Help, but I am somewhat confused about the arguments that
are need to perform this action.
Thanks,
Anthony


.
 
Create your own specification and use that.

Begin the export process manually, and when the wizard window opens, click
the Advanced button in the lower left corner. Set the specifications the way
you want them (width of each field, delimiter to use, etc.) and save those
settings under a name. Close the export process without continuing further.
Use the name that you stored the spec under as the argument in your
TransferText action.


--
Ken Snell
<MS ACCESS MVP>

CH said:
For the argument of strSpecName, how to make that if I
would like to have Tab for the delimiter?

Thanks in advence.
-----Original Message-----
This might help:

DoCmd.TransferText acExportDelim, strSpecName, strTableName,
Me![txtLocalDir] & Me![txtLocalFileName], True
--
Joe Fallon
Access MVP



I am trying to export a table to a csv file. I would like to do this via
code. I read the Help, but I am somewhat confused about the arguments that
are need to perform this action.
Thanks,
Anthony


.
 
The wizard window did not open; am I missing something?
Ken Snell said:
Create your own specification and use that.

Begin the export process manually, and when the wizard window opens, click
the Advanced button in the lower left corner. Set the specifications the way
you want them (width of each field, delimiter to use, etc.) and save those
settings under a name. Close the export process without continuing further.
Use the name that you stored the spec under as the argument in your
TransferText action.


--
Ken Snell
<MS ACCESS MVP>

CH said:
For the argument of strSpecName, how to make that if I
would like to have Tab for the delimiter?

Thanks in advence.
-----Original Message-----
This might help:

DoCmd.TransferText acExportDelim, strSpecName, strTableName,
Me![txtLocalDir] & Me![txtLocalFileName], True
--
Joe Fallon
Access MVP



I am trying to export a table to a csv file. I would like to do this via
code. I read the Help, but I am somewhat confused about the arguments that
are need to perform this action.
Thanks,
Anthony




.
 
It won't open if you run the code. You must use File | Export ... option on
the menu bar to start the export process manually. After you select the
target file where the export is to go, the wizard will open. At the bottom
left side of the wizard window will be a button named Advanced. Click that
and you'll see a window that lets you set all the specification info for
your export. After setting all the options the way you want, click the Save
As button to save the specification under some name. After saving the
specification, cancel the export process.

Then you can use in your code the specification name that you saved.

--
Ken Snell
<MS ACCESS MVP>

Anthony Viscomi said:
The wizard window did not open; am I missing something?
Ken Snell said:
Create your own specification and use that.

Begin the export process manually, and when the wizard window opens, click
the Advanced button in the lower left corner. Set the specifications the way
you want them (width of each field, delimiter to use, etc.) and save those
settings under a name. Close the export process without continuing further.
Use the name that you stored the spec under as the argument in your
TransferText action.


--
Ken Snell
<MS ACCESS MVP>

CH said:
For the argument of strSpecName, how to make that if I
would like to have Tab for the delimiter?

Thanks in advence.

-----Original Message-----
This might help:

DoCmd.TransferText acExportDelim, strSpecName,
strTableName,
Me![txtLocalDir] & Me![txtLocalFileName], True
--
Joe Fallon
Access MVP



message
I am trying to export a table to a csv file. I would
like to do this via
code. I read the Help, but I am somewhat confused about
the arguments that
are need to perform this action.
Thanks,
Anthony




.
 
Back
Top