Export Trouble

mboe

Registered User.
Local time
Today, 16:32
Joined
Dec 27, 2000
Messages
51
I am trying to export a table to a .csv format with no text qualifiers. I created a spec file with comma delimited and no text qulifier but I still get "" around all my data fields. The program that needs the data can't import with "" in the data fields. Here is a copy of my code but I don't think there is anything wrong with it. Another oddity is that, although I can export with my code, I can't get a manual export to work. It always says "invalid argument"???? I don't get that. Any help would be appreciated. Thanks!

Private Sub cmdRunExport_Click()
On Error GoTo Err_cmdRunExport_Click

Dim jbtable As String
Dim StdResponse As Integer
jbtable = "JBExport" & Format(DMax("[dt_lst_txn]", "public_dda2a"), "yymmdd")
StdResponse = MsgBox("Do you want to create a new export file?", vbOKCancel + vbDefaultButton1)

If StdResponse = vbOK Then '
If Me![txtSavingsRate] > 0 And Me![txtXmasRate] > 0 And Me![txtNowRate] > 0 And Me![txtIMMARate] > 0 And Me![txtSuperNowRate] > 0 Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "DDA"
DoCmd.OpenQuery "CD"
DoCmd.OpenQuery "Loans"
DoCmd.OpenQuery "Savings"
DoCmd.Rename jbtable, acTable, "export"
DoCmd.Close
DoCmd.SetWarnings True
' Export Table
DoCmd.TransferText acExportDelim, jbexportspecs, jbtable, _
"c:\documents and settings\mike\desktop\" & jbtable & ".csv"
MsgBox "Export Table " & jbtable & "has been created and exported to " & jbtable & ".csv", vbOKOnly, "Export Confirmation"

Else
MsgBox "All fields must be completed before running Export", vbOKOnly, "Export Error"
End If
Else
GoTo Exit_cmdRunExport_Click
End If


Exit_cmdRunExport_Click:
Exit Sub

Err_cmdRunExport_Click:
MsgBox Err.Description
Resume Exit_cmdRunExport_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom