Turn off warning message

A

Ashley

I am using macro to output a file to a folder.
I have tried Setwarning/NO before the action. Why the
warning message still come up "Do you want to replace
existing files?" Can anyone show me how to turn off the
warning message?

Thanks
 
K

Ken Snell

Set Warnings does not trap this Window message. You'll need to use VBA code
to avoid this message box. That code will "Kill" the existing file and then
put the new file in its place -- all without warnings:

If Dir("C:\MyFolder\Filename.txt") <> "" Then Kill
"C:\MyFolder\Filename.txt"
DoCmd.OutputTo (.. rest of arguments)

Post back if you need assistance on how to set up this VBA code.
 
A

Ashley

Steve,
I need your assistance on how to set up VBA code.
I have two reports (rptFinalTest and rptSafetyTest) that I
want to output at same time to \..\Server2
\web\Intranet\Performance Metrics\ with snapshot format
with file name such as "Final Test.snp" and "Safety
Test.snp", autostart/NO.
Please help me "Kill" the existing snp files in the above
directory and Output new snp files to the same directory.

Thank you for your help.
 

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

Similar Threads


Top