By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

setwarnings action default assumptions

P: 2
Database: MS Access

Subject: SetWarnings macro action

I am running macos to run several action queries that replace existing tables with new data based on parameter dates. There are several tables to update and to avoid the annyance of promts system messages have added an argument at the beginning of the macro to switch the warning off:

Action: SetWarnings
Argument: No

everything seemed fine but i have since realised that the action queries were not running - the reason being: "Carrying out this action with the Warnings On argument set to No has the same effect as pressing ENTER whenever a warning or message box is displayed. Typically, an OK or Yes button is chosen in response to the warning or message"

the typical message i would get on running the query would be:
The existing table "table" will be deleted before you run the query. Do you want to run the query anyway?
the default answer (the result of pressing enter) is "no"
I want it to say yes - delete the table and replace the date
hence it would appear that the setwarning action will not work for me

Has anyone else encountered the same issue - and can anyone suggest a neat solution?

Many Thanks

Apr 4 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,327
Delete the table with code before running the make table query.
Apr 4 '07 #2

Expert 100+
P: 1,356
If you put this in a function in VBA code you can use your macro to call this function and it will work. I don't typically use macros I would just call the function however I am not sure how you have this set up or where you are calling the macro from.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
Make sure you change it back to true when you are done or you could delete things, save things etc. and never realize it since you will get no prompt whatsoever.
Apr 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.