Brock, Christian T, HRC-Alexandria/NGIT
Christian.Brock at hoffman.army.mil
Fri Mar 25 16:25:03 CST 2005
Make Sline a variant and you can use one line for the concatenation and avoid a comma at the end since concatenating two expressions together using + where one is null gives you a null. Dim vLine as variant vLine = Null While not .eof vLine=vLine + "," & str(fZip) .movenext vLine=vLine + "," & str(fZip) Christian Brock -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Perry Harold Sent: Friday, 25 March 2005 16:58 To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Output text file--HELP Mark How about? (AirWare just for ideas.) Dim sLine as string Open DB Open Tbl Open XX.txt for output as #X If not .bof then .movefirst While not .eof sLine=sLine & str(fZip) 'use format "00000" if have any less than length 5 .movenext Sline=sline & "," loop Wend Print #X, sline Close #X Close tbl Close DB end -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Friday, March 25, 2005 4:22 PM To: accessd at databaseadvisors.com Subject: [AccessD] Output text file--HELP Hello All, Of course its Friday...I have a table with one field...its a zip code...I need all records in the field to be in a string. I know its not that hard...but the brain isn;t working right. I want to output the following: Record Zip 1 55555 2 54879 3 12345 I need a string( preferable in a text document) like "55555,54879,12345" I thought this would be a simple loop through the recordset and output to a .txt file...but I cant seem to figure it out. Best approaches? Thanks, Mark A. Matte -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com