Export with Formatting

dmyoungsal

Registered User.
Local time
Today, 15:55
Joined
May 1, 2016
Messages
112
I have an export that I am running through Autoexec and while it is working really well coming out as an xls formatted file, I actually need it to come out as CSV.

Being exported as a text file makes the file come out with "|" and "-" and "+".

Ideas?
 
no code, just used the functions within the autoexec.
 
What functions are used in the AutoExec? Could you post a screen shot of the AutoExec?
 
What functions are used in the AutoExec? Could you post a screen shot of the AutoExec?

"ExportWithFormatting"
Object Type Query
Object Name qryName
Output Format Text Files (*.txt)
Out File p:\foldername\RMPUpload.csv
Auto Start No
Template File
Encoding
Output Quality Print
 
Please try the following.

1. Create a module and paste the following code in it.

Code:
Public Function TransferText()

DoCmd.TransferText acExportDelim, , "qryName", "P:\foldername\RMPUpload.csv"

End Function

2. Save the module. Give it any name you like just not the name of an existing function. For example TransferText would be a bad name but TransferText Module would be ok.

3. Delete the existing code in your autoexec macro or you could rename it to let's say autoexec_old and create a new AutoExec macro

4. In the AutoExec macro Add the line RunCode TransferText(). Make sure TransferText() has the closing parenthesis. It should look like.

attachment.php


I think this will give the result you want.
 

Attachments

  • AutoExec.jpg
    AutoExec.jpg
    66.9 KB · Views: 938
This is the Module1
Option Compare Database
Public Function ExportRM()
DoCmd.TransferText acExportDelim, , "qryRFIDEIDLocation", "p:\rental man\FTPRM\RMUpload.csv"
End Function

I open the DB (which triggers the Autoexec) and I am not getting any data out.
 
This is the Module1
Option Compare Database
Public Function ExportRM()
DoCmd.TransferText acExportDelim, , "qryRFIDEIDLocation", "p:\rental man\FTPRM\RMUpload.csv"
End Function

I open the DB (which triggers the Autoexec) and I am not getting any data out.


Never mind.... I spoke to early..... I just needed to add field names (which I did)

it works!!!!! Thank you.
 

Users who are viewing this thread

Back
Top Bottom