Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / June 2005

Tip: Looking for answers? Try searching our database.

"Set Warnings" - Set but still get warnings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robin Chapple - 26 Jun 2005 23:45 GMT
I have used "Set Warnings" to No so that I can overwrite regular
reports and thus delete the older version.

I have just built a macro which outputs four reports in the same way
as above.

This time I am getting a warning that the "File already exists"

Can this be raised out side the macro?

Thanks,

Robin Chapple
Douglas J. Steele - 26 Jun 2005 23:54 GMT
I believe "File already exists" is an error, not a warning.

You need to check whether or not the file already exists, and if it does,
delete it before trying to write to it.

To be honest, I'm not sure how you'd do that in a macro: I never use them.
It's simple in a VBA module, though.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have used "Set Warnings" to No so that I can overwrite regular
> reports and thus delete the older version.
[quoted text clipped - 9 lines]
>
> Robin Chapple
Steve Schapel - 27 Jun 2005 01:08 GMT
Robin,

Doug is right, this can't be done with a macro.  You would need to use
the Kill method in a VBA procedure to delete the file first.

Signature

Steve Schapel, Microsoft Access MVP

> I believe "File already exists" is an error, not a warning.
>
[quoted text clipped - 3 lines]
> To be honest, I'm not sure how you'd do that in a macro: I never use them.
> It's simple in a VBA module, though.
Robin Chapple - 27 Jun 2005 08:00 GMT
Thanks Guys,

I hear what you say but I have other macros that make files on a
weekly basis for reporting purposes and they *DO* overwrite the
previous version. They have been running for years.

I'll convert the macro to VBA.

Robin

>Robin,
>
>Doug is right, this can't be done with a macro.  You would need to use
>the Kill method in a VBA procedure to delete the file first.
Robin Chapple - 27 Jun 2005 08:12 GMT
Doug and Steve,

Humble pie eating day.

Conversion to VBA was the answer and that is what happened to the
existing ones long ago.

"Old Timer's Disease" is thriving. My apologies.

Robin

>I believe "File already exists" is an error, not a warning.
>
[quoted text clipped - 3 lines]
>To be honest, I'm not sure how you'd do that in a macro: I never use them.
>It's simple in a VBA module, though.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.