Warning message

Ben_Entrew

Registered User.
Local time
Today, 14:16
Joined
Dec 3, 2013
Messages
177
Hi all,

although I wrote: DoCmd.SetWarnings False

Somehow I get the following warning message:

The existing table INCOMING_ORDERS_REPORT will be deleted before you run the query.

Further under Help it shows me :
If your intention is to create or replace a table, click Yes. To avoid being prompted when you run such queries, click the Microsoft Office Button, then click Access Options, and then click Advanced. Under Editing, clear the Action queries check box.

I cleared the Action query check box.

Does anyone has a clue? How can I avoid this warning message?
Thanks in advance.

Regards,
Ben
 
Thanks for the hint.

I tried both ways with DoCmd.SetWarnings False and CurrentDb.Execute "DROP TABLE INCOMING_Orders_REPORT", dbFailOnError.

Nothing helps, it still shows me the warning message.
 
Code:
Public Sub DELETE_QUICK()
DoCmd.SetWarnings False
CurrentDb.Execute "DROP TABLE INCOMING_Orders_REPORT", dbFailOnError
DoCmd.SetWarnings True
End Sub
 
I want the SQL that "DROP TABLE INCOMING_Orders_REPORT" refers to..
 
Code:
Public Sub DELETE_QUICK()
DoCmd.SetWarnings False
CurrentDb.Execute "DROP TABLE INCOMING_Orders_REPORT", dbFailOnError
DoCmd.SetWarnings True
End Sub

Remove the lines that include SetWarnings

Do you want to
a) Delete all rows in the table, or
b) remove the table and all of its indexes etc.

If a) then use DELETE not DROP
If b) then carry on.
Good luck
 
Thanks to all your replies.

My problem was related to the calling environment,
I've changed the position where the Delete Statement is calles,
now it works out.

Thanks again.

Regards,
Ben
 
Ah! That is the SQL ... Opp's didn't spot that!
 

Users who are viewing this thread

Back
Top Bottom