Rocky Smolin - Beach Access Software
bchacc at san.rr.com
Fri Jun 20 23:23:09 CDT 2003
Stuart: I once implemented a clipboard function in an app. It came from John Colby's site. Look for C2DbClipBoard. It has functions to copy, paste, and empty the clipboard. Rocky Smolin Beach Access Software ----- Original Message ----- From: "Stuart McLachlan" <stuart at lexacorp.com.pg> To: "Mark Boyd" <MarkBoyd at McBeeAssociates.com>; <accessd at databaseadvisors.com> Sent: Friday, June 20, 2003 2:56 PM Subject: Re: [AccessD] Copy and paste from clipboard > On 20 Jun 2003 at 17:03, Mark Boyd wrote: > > > This may seem like a strange request, but I've been asked by my boss to > > check with this list. > > > > > > > > She has a process that exports a 1-record table to a text file. This > > text file is then imported into a client's billing system. > > > > Currently, she is using 'DoCmd.TransferText, acExportDelim ...' to > > create the text file. The problem comes about when the other system > > tries to read the text file. It kicks back an error stating that it > > can't find the end-of-file. > > > > > > > > Although, when she simply copies the text from the table, then pastes it > > into a text file, the client's system imports it without a problem. > > > > > > > > Is there a way (in code) to copy the data from the table to the > > clipboard, then paste it from the clipboard to a text file? > > > Why not just do something like the following: > (Change the "," to Chr$(9) for Tab delimited) > > > Dim strExport as String > Dim rs as Recordset > Dim loopcount as long > Dim NoOfFields as long > > Set rs = currentdb.openrecordset("tblSimgleRecordTable") > > NoOfFields = rs.Fields.Count > > 'Build comma delimited export string > For loopcount = 0 to NoOfFields - 2 > strExport = strExport & rs(loopcount) & "," > Next > strExport = strExport & rs(NoOfFields) - 1) > > Open "transferfile.txt" for output as #1 > Print#1, strExport > Close #1 > > > > -- > Lexacorp Ltd > http://www.lexacorp.com.pg > Information Technology Consultancy, Software Development,System > Support. > > > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >