how to output Access table to a text document?

M

Michelle

I have an Access file. When I open it up, and click on a Table, data
shows up in field columns, where some field columns may have 1 word in
it, some fields may have 2, 3 words in each field column, and so
forth. I would like to output this Access table to a text
document.

Is it possible to output an Access table to have a certain character,
let's say | as a field separator?

so if I were to view the text file after the output, it would look
something like this:


John | Doe | 123 Main Street | Bank of
America
Jane | Doe A. | 456 First Ave. West | Wamu
Tom | Smith | 50 South First St. | Citibank
 
M

MGFoster

Michelle said:
I have an Access file. When I open it up, and click on a Table, data
shows up in field columns, where some field columns may have 1 word in
it, some fields may have 2, 3 words in each field column, and so
forth. I would like to output this Access table to a text
document.

Is it possible to output an Access table to have a certain character,
let's say | as a field separator?

so if I were to view the text file after the output, it would look
something like this:


John | Doe | 123 Main Street | Bank of
America
Jane | Doe A. | 456 First Ave. West | Wamu
Tom | Smith | 50 South First St. | Citibank

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

1. Right click on the table you want to export.
2. Select Export from the pop-up menu. The Export dialog appears.
3. Select Text File from the "Save As Type" field.
4. Navigate to the folder you want to save the file.
5. Click OK. The File Specification dialog appears.
6. Click the Advanced button.
7. Enter the | character in the "Field Delimiter" field.
8. Select {none} in the "Text Qualifier" field.
9. Click OK. (Or save the spec with a name).
10. Click the Finish button.

If you want to do this via VBA code read the TransferText Method in the
VBA help file (hint: Ctrl-G; type TransferText; keep the cursor on the
word & hit the F1 button).

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSk7BFYechKqOuFEgEQJt2QCeP1Rs8I6vdOClwOc1JCOR5PJqXSoAnjQk
OcjvDL2QbX6Qtz4TSDijTyhu
=+H68
-----END PGP SIGNATURE-----
 
F

fredg

I have an Access file. When I open it up, and click on a Table, data
shows up in field columns, where some field columns may have 1 word in
it, some fields may have 2, 3 words in each field column, and so
forth. I would like to output this Access table to a text
document.

Is it possible to output an Access table to have a certain character,
let's say | as a field separator?

so if I were to view the text file after the output, it would look
something like this:

John | Doe | 123 Main Street | Bank of
America
Jane | Doe A. | 456 First Ave. West | Wamu
Tom | Smith | 50 South First St. | Citibank

Select the table.
Click on File + Export
When the Export wizard opens, enter the name you wish for the new text
file. In the Save As Type drop-down select
Text Files (*.txt,*.csv,*,*.tab,*.asc)

Click OK.
The Export Specification wizard will then open.
Click on Advanced.
Enter the | as the Field Delimiter, None as the Text Qualifier, and
make any of the other changes to the default items you wish. Save and
name the change, i.e. "StandardExport".
Continue with the wiazrd. Click Finish.

The above has to be done just once.
The Access table will be exported as a | delimited text file. You can
now insert this file into a word document.

The next time you need to export a table, you can repeat the above.
When the Export wizard opens you can click on the Specs button and
select the specification named "StandardExport" so you won't have to
completely re-do the export.
or ..
If you wish to use code, you can use the TransferText method and
specify the "StandardExport" as the export specification argument.
Look this up in VBA help.
 
Top