Suppress Overwrite & System Messages within Macro

  • Thread starter Thread starter rapp58
  • Start date Start date
R

rapp58

Guest
:confused: I am a new user of MS Access and have developed a database to query against changes to customer records (name, location, phone) for our facilities group. I have built queries and reports and work tables and have verified everything works correctly. I then built a macro to automate everything and put the reports out to HTML. Everything works but the problem I have run into is that a system prompt will come up when doing the output to and ask if I want to overwrite the existing file. I have searched for days on how to build into the macro a means to automatically answer 'yes' to these messages and to suppress them. Does anyone have this type of feature built into a macro and if so, how did you structure it? If not, is there a way to build into a macro to move the files to a different folder first and then execute the output to ?

I appreciate any help anyone can offer. Thank you.
 
have you tried SETWARNINGS
 
Suppress Messages

Set Warnings off is the first item in my macro.... I am still prompted.... Thank you.
 
I too get the same problem with "overwrite?" messages with setwarnings=off. Can anyone help with this?
 
Delete the file with the kill statement first.

Kill Statement


Deletes files from a disk.

Syntax

Kill pathname

The required pathname argument is a string expression that specifies one or more file names to be deleted. The pathname may include the directory or folder, and the drive.

Remarks

In Microsoft Windows, Kill supports the use of multiple-character (*) and single-character (?) wildcards to specify multiple files. However, on the Macintosh, these characters are treated as valid file name characters and can't be used as wildcards to specify multiple files.

Since the Macintosh doesn't support the wildcards, use the file type to identify groups of files to delete. You can use the MacID function to specify file type instead of repeating the command with separate file names. For example, the following statement deletes all TEXT files in the current folder.

Kill MacID("TEXT")

If you use the MacID function with Kill in Microsoft Windows, an error occurs.

An error occurs if you try to use Kill to delete an open file.

Note To delete directories, use the RmDir statement.

???
kh
 

Users who are viewing this thread

Back
Top Bottom