I am using the DoCmd.RunSQL method to INSERT and DELETE records based on actions that a user makes in a form. It works fine but it asks for a confirmation before deleting or appending a record. How can I remove the confirmation.
By the way, the BeforeDelConfirm event doesn't seem to run with DoCmd.RunSQL.
Rather than using DoCmd.RunSql
to run your SQL and worrying about alerts you can use this.
Dim sql as string
Dim dbs as DAO.Database
set dbs = CurrentDb()
sql = "INSERT INTO table(field1) VALUES(1)"
dbs.Execute sql, dbFailOnError
dbs.close
set dbs = nothing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With