?
Solved

MS Access - stopping it asking whether ok to overwrite

Posted on 2003-03-02
5
Medium Priority
?
237 Views
Last Modified: 2012-06-27
HI there,

Hopefully an easy one!

I have set up a macro to send 2 reports using outputto to a file as html docs.

I want these to be sent when the form closes so have attached the macro to the close button.

However it keeps asking whether it is ok to overwrite the files as they already exist.

Can I disable this so it automatically saves over them ?

Thanks

Dave
0
Comment
Question by:plusone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 200 total points
ID: 8051489
Have you done this in VBA?

How about adding something like this to delete the file if it exists first?

filename$="c:\myfilename.html"
if dir$(filename$)<>"" then KILL filename$

Steve
0
 
LVL 3

Expert Comment

by:Moliere
ID: 8051505
You can use the brute force method of wrapping:

docmd.setwarnings false
.
.
.
docmd.setwarnings true

around the code that outputs to html.h
0
 

Expert Comment

by:KodeBunny
ID: 8055382
The SetWarnings action will not work with overwriting a file.  

In your macro, instead of using the OutputTo action, perhaps you could try the TransferText action.  The TransferText will give you similar results.  

Set the Action to TransferText instead of OutputTo.  Set  Transfer Type argument to Export HTML; the rest of the arguments as needed.
0
 
LVL 3

Expert Comment

by:crimper
ID: 9563016
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by Dragon-it

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

John Pullin
EE Cleanup Volunteer
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
New style of hardware planning for Microsoft Exchange server.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question