Another option just for info should you wish to try
This is a small form with a combo box listing all tables and queries in your database
You Select the table or query to output to CSV
Then in an unbound textbox underneath you put the name of the file you wish to create
then you press the create CSV button and that's that provided you've copied everything below to the right places.
Hope this is of some use to you
Jo
Create a form with the following controls on it
combo box with row source of
SELECT DISTINCTROW [MSysObjects].[Name] FROM MSysObjects WHERE ((([MSysObjects].[Name]) Not Like "MSys*" And ([MSysObjects].[Name]) Not Like "~*" And ([MSysObjects].[Name]) Not Like "zt*"

And (([MSysObjects].[Type]) In (1,5))) ORDER BY [MSysObjects].[Name];
name cboTbl
An unbound textbox called txtfilename
cmd button
name: cmdOutputToCSV
caption: OutputToCSV
Event On click
Private Sub cmdOutputToCSV_Click()
'Calls Mkcsv which takes the object selected and outputs it to a csv file
'using the path typed int thebbox
On Error GoTo csverr
Dim obj As String
Me.lblfilepath.Visible = True
Me.Refresh
obj = Me.cboTbl
Call mkcsv(obj)
Me.lblfilepath.Visible = False
csverrexit:
Err = 0
Exit Sub
csverr:
MsgBox Error$(Err)
GoTo csverrexit
End Sub
cmd button close
usual close form code here
the make CSV code calls the following function which you copy & paste into a module
Sub mkcsv(objname As String)
On Error GoTo mkcsverr
Dim mydb As Database
Dim myrs As Recordset
Dim fldcount As Integer
Dim fld As Field
Dim x As Integer
Dim printstr As String
Dim fs As Object
Dim a As Object
Dim fname As String
Set mydb = CurrentDb
Set myrs = mydb.OpenRecordset(objname, dbOpenDynaset)
fname = Forms!frmexporttocsv!txtfilename & ".txt"
Set fs = CreateObject("Scripting.FileSystemObject"

Set a = fs.CreateTextFile("c:\" & fname, True)
a.Close
DoCmd.Hourglass True
Open "c:\mycsv.txt" For Output As #1
Do Until myrs.EOF
For x = 0 To myrs.Fields.Count - 1
If x <> myrs.Fields.Count - 1 Then
printstr = printstr & myrs.Fields(x).Value & ","
Else
Print #1, printstr & "," & myrs.Fields(x).Value
'Print #1, vbNewLine
End If
Next x
myrs.MoveNext
printstr = ""
Loop
Close #1
DoCmd.Hourglass False
'MsgBox "Text file " & fname & "created to " & PathName
mkcsverrexit:
Err = 0
Exit Sub
mkcsverr:
MsgBox Error$(Err)
GoTo mkcsverrexit
End Sub