This OUTPUT action too tough

M

MER

Air code

DoCmd.outptto acreport, "reportname", "MS
DOS..txt..", "C:\filename", false, """",

the problem is that the first time I click on this
commandbutton I get the file generated on DOS just fine,
But the subsequent times do not seems to update or
overwrite the c:\filename. Yet if I do the process
manually, File Export etc etc, ACCESS prompts me "DO YOU
WANT TO OVERWRITE THE FILENAME?" and if I click yes, it
does so

no one answered a few days ago, must be a tough one................
 
J

John Vinson

Air code:

DoCmd.outptto acreport, "reportname", "MS-
DOS..txt..", "C:\filename", false, """", 1

the problem is that the first time I click on this
commandbutton I get the file generated on DOS just fine,
But the subsequent times do not seems to update or
overwrite the c:\filename. Yet if I do the process
manually, File Export etc etc, ACCESS prompts me "DO YOU
WANT TO OVERWRITE THE FILENAME?" and if I click yes, it
does so.


no one answered a few days ago, must be a tough one.................

One possibility would be to use the Kill function to delete the file
first: trap and ignore the error if the file doesn't exist.

On Error Resume Next
Kill "C:\filename"
On Error GoTo Proc_Error
DoCmd.Outputto...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top