Stuart McLachlan
stuart at lexacorp.com.pg
Sun Aug 16 16:08:03 CDT 2009
That's what I frequently use - but only where I am sure that the user will be able to delete the old file. If for some reason the file can't be deleted - in use, set as ReadOnly or the user doesn't have suitable permissions on the file or directory, you may be still left with old file and not realise it. Where there are these possibilities, you need to set up a full error trap and only Resume Next if the file doesn't exist. If you get any other error you need to advise the user accordingly. In your case you are using gstrBackEndPath. Could two people try to work with the same file at the same time? -- Stuart On 16 Aug 2009 at 6:56, Rocky Smolin wrote: > Dear List: > > I am exporting a bill of materials to a spreadsheet from an access database. > The file name on the spreadsheet is the part number the user selects plus > some other stuff. > > Before I create it I issue a Kill: > > Kill gstrBackEndPath & Forms!frmBFGExportBOM!txtAssemblyPartNumber & " - BOM > Export.XLS" > > If the file is not there it generates an error of course, file not found. > > Is there anything wrong with the simple workaround: > > On Error Resume Next > Kill gstrBackEndPath & Forms!frmBFGExportBOM!txtAssemblyPartNumber & " - BOM > Export.XLS" > On Error GoTo 0 > > > MTIA, > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > www.e-z-mrp.com <http://www.e-z-mrp.com/> > > www.bchacc.com <http://www.bchacc.com/> > > > > > >