C
Chris Freeman
I'm doing an export to a CSV file, that needs extra rows of information. I
have the coding to print individual fields, but in stead of doing that, I
have 18 fields in the query, I want to print out all fields. i can't seem to
get it to work, so i can't seem to get it to work, and have been spending
all morning looking for examples, but everything I find is printing from
Excel. So far I have:
Set currdb = Application.CurrentProject.Connection
Set rst = New ADODB.Recordset
strSql = "SELECT * FROM qry_Reissue_Check_Req"
rst.Open strSql, currdb, adOpenDynamic, adLockOptimistic
fileout = FreeFile
Open FileName For Output As #fileout
If rst.EOF And rst.BOF Then
GoTo PROC_ERR_1
Else
Print #fileout, Chr(34) & DT & Chr(34)
L = 0
Do
Print #fileout, Chr(34) & rst.Fields![BR] & Chr(34) &
","....etc...
L = L + 1
Loop Until L = 5
FC = L * 18 '18 is the field count of the current ReIssue Chk
Req query
Print #fileout, Chr(34) & L & Chr(34) & "," & Chr(34) & FC & Chr(34)
End If
I know this is one of those simple little things, but I just can't seem to
lock it down.
Thanks for your help.
have the coding to print individual fields, but in stead of doing that, I
have 18 fields in the query, I want to print out all fields. i can't seem to
get it to work, so i can't seem to get it to work, and have been spending
all morning looking for examples, but everything I find is printing from
Excel. So far I have:
Set currdb = Application.CurrentProject.Connection
Set rst = New ADODB.Recordset
strSql = "SELECT * FROM qry_Reissue_Check_Req"
rst.Open strSql, currdb, adOpenDynamic, adLockOptimistic
fileout = FreeFile
Open FileName For Output As #fileout
If rst.EOF And rst.BOF Then
GoTo PROC_ERR_1
Else
Print #fileout, Chr(34) & DT & Chr(34)
L = 0
Do
Print #fileout, Chr(34) & rst.Fields![BR] & Chr(34) &
","....etc...
L = L + 1
Loop Until L = 5
FC = L * 18 '18 is the field count of the current ReIssue Chk
Req query
Print #fileout, Chr(34) & L & Chr(34) & "," & Chr(34) & FC & Chr(34)
End If
I know this is one of those simple little things, but I just can't seem to
lock it down.
Thanks for your help.