On my form I have a button, which runs code to delete records from a
temporary table:
DoCmd.RunSQL "DELETE myTMPtable.* FROM myTMPtable"
Is it possible to programmatically suppress the delete warning?
Thank you in advance for any tips!
Ofer - 29 Jul 2005 12:34 GMT
Use the setwarnings command to false
Docmd.SetWarnings False
DoCmd.RunSQL "DELETE myTMPtable.* FROM myTMPtable"
Docmd.SetWarnings True
Don't forget to set the warnings back to true
> On my form I have a button, which runs code to delete records from a
> temporary table:
[quoted text clipped - 4 lines]
>
> Thank you in advance for any tips!
Allen Browne - 29 Jul 2005 13:08 GMT
Best solution:
dbEngine(0)(0).Execute "DELETE...", dbFailOnError
That generates no message, unless something goes wrong (e.g. a record could
not be deleted because someone is editing it.)

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> On my form I have a button, which runs code to delete records from a
> temporary table:
[quoted text clipped - 4 lines]
>
> Thank you in advance for any tips!