Turn off warning message

  • Thread starter Thread starter Ashley
  • Start date Start date
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
 
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.
 
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.
 
Back
Top