John Skolits
askolits at ot.com
Fri Sep 1 08:14:03 CDT 2006
Rocky, I tried this by creating an 'unbound' form and ran it multiple times and it just kept overwriting the file with no problem. Was your form bound? The various output files names I placed in the text box 'txtOutputFileName' were: "c:\test.xls" "c:\test 2.xls" "test.xls" "test 2.xls" Since you didn't specify a path, I tried it with and without one. When no path was specified, it obviously used the default. 'MyDocuments' John -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin - Beach Access Software Sent: Thursday, August 31, 2006 7:47 PM To: Access Developers discussion and problem solving Subject: [AccessD] File Copy Dear List: When I run a chunk of code which includes: FileCopy "Cressona Template.xls", Me.txtOutputFileName it runs fine. If I run it again, however, without closing the form and reopening it (but deleting the target file specified in Me.txtOutputFileName that was created the first time), I get an error 52 - bad file number. Does anyone know why? MTIA, Rocky -- Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com