Macro Using "Output to"

R

Roger

I have finally mastered using the "output to" function of a macro to a specfic file that includes the month # (mm) in the file name. In the event I need to re-run the macro and re-generate the file....Is the a way to avoid the need to answer the question " This file already exist Do you want to replace it?
TI
Roger
 
N

Nikos Yannacopoulos

Roger,

Before the OutputTo action, insert an action SetWarnings, arguments: False
Make sure to include another to reverse this (arguments: True) after the
OutputTo action, or Access will do everything without asking for
confirmation thereafter!

HTH,
Nikos

Roger said:
I have finally mastered using the "output to" function of a macro to a
specfic file that includes the month # (mm) in the file name. In the event
I need to re-run the macro and re-generate the file....Is the a way to avoid
the need to answer the question " This file already exist Do you want to
replace it?"
 
R

Roger

I know this "setwarnings" works in access but the output file is to a *.rft file to be used by Word. I think the " This file already exist Do you want to replace it?" warning is coming from word or windows in general
I have tried setwarning both ways an still get the warning
Roge


----- Roger wrote: ----

I have finally mastered using the "output to" function of a macro to a specfic file that includes the month # (mm) in the file name. In the event I need to re-run the macro and re-generate the file....Is the a way to avoid the need to answer the question " This file already exist Do you want to replace it?
TI
Roger
 
W

Will

Roger
I had this same problem, but nobody seemed to have an answer. Finally I have one! Somebody was having the exact opposite problem as us, but he was using VB code. The code and method is really easy to use

If you are running it off of a button, in the On Click event for the button properties, select event procedure
Next select the build button. This should take you into the VB code editor. Your function should look something like this

Private Sub Command10_Click(
DoCmd.RunMacro ("MacroName") 'Note: Must include " " around macro nam

End Su

I tried this out on my own macro, and it works great. Hope it helps
Will
 

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