delete and replace table without prompting "confirmation"

learning_grexcel

Active Member
Joined
Jan 29, 2011
Messages
319
Every time i run the code below, it pops an confirmation whether to delete already existing table.

Code:
select * into table1
from query1

I don't want to pop up such a window and automatically it should be replaced when I run the update query.

I already tried unchecking the advanced access option. [record changes], [document deletions], [action queries] but it still pops up the confirmation.

This will be help me to create an autoexec macro and schedule it once a day.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Its the "SetWarning" command you are looking for (one of the "Actions" in "Macros").
Set it to "No".
 
Upvote 0
I can't see your screen print from my current location (my workplace blocks those images).

Make sure the SetWarning command comes before your RunQuery command.
 
Upvote 0
Thanks joe.

But it's still not working and 'an yellow question' mark appears before Macro name in SetWarnings. Please see my setting is as below
Macro Name >> Action >> Arguments
Autoexec >> SetWarnings >> No
Autoexec >> OpenQuery >> queryname, Datasheet, Edit
 
Upvote 0
Yellow question mark (?), or yellow exclamation mark (!)?
Mine has the exclamation mark, which is normal.

Can you post the full SQL code of your query?
What exactly is the pop-up message saying?
 
Upvote 0
Two things.

One, Set Warnings No needs to be *before* the action query
(And, once finished the delete / append, put Set Warnings Yes)
Two, those exclamations appear in 2007 and above. A range of macro actions are disabled by default. I wrote an article a while back that shows what to do...
http://www.datawright.com.au/access_resources/why_wont_my_macro_run_in_Access_2007.htm

And a third point ;)
Instead of deleting and recreating the table, why not just delete the data and re-append the new? That means that any properties you set for fields in the table will remain.

Denis
 
Upvote 0

Forum statistics

Threads
1,203,754
Messages
6,057,156
Members
444,908
Latest member
Jayrey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top