Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with creating a csv file 1

Status
Not open for further replies.

debbieg

Technical User
Dec 2, 2002
190
US
I am trying to create a csv file that will be imported into ADP PC/Payroll system.

My first try created an error:
Code:
strSaveFileName = "C:\ADP\PCPW\ADPDATA\"
strSaveFileName = strSaveFileName & "EPI" & CoCode & BatchID & ".csv"

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblADP", strSaveFileName, True
Cannot update. Database or object is read-only.

My second try created gibberish when the file is opened in NotePad:
Code:
DoCmd.OutputTo acOutputTable, "tblADP", acFormatXLS, strSaveFileName, False

My third try is this:
Code:
DoCmd.TransferText acExportDelim, , "tblADP", strSaveFileName, True
This works great except that one of the field names is "File #" -- this is required. The # is causing me problems. It is being converted to a period (.).

How can I make the header appear as "File #".

I have to get this to work by Thursday!

Thanks in advance for any help.
Debbie
 
Nice,

Thanks so much ... Method 5 worked like a charm.

Method 3 states "Modify the resulting exported file so that the field names have the characters that you want." How would I do that? That's what I wanted but couldn't figure out how to do it.

I always have trouble finding solutions in Microsoft because I never use the keywords that they need.

Thanks again!
Debbie
 
Debbie, I don't know how #3 would work. But maybe one of the MVP's can step in.

I myself always use step #5.
 
Method 3:
Open the resulting export file with NotePad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top