DoCmd.RunSQL question

  • Thread starter Thread starter mosquitooth
  • Start date Start date
M

mosquitooth

Hi

in my new Access- DB I sometimes use the function
DoCmd.RunSQL - query, passing a valid SQL statement, but
everytime I do this, I get the following remark:

"You are about to modify/delete/etc...", waiting for the
user to reply.

How can I avoid this?

Thanks
mosquitooth
 
Try ...

CurrentDb.Execute "Insert your SQL action query here", dbFailOnError

hth,
 
mosquitooth said:
Hi

in my new Access- DB I sometimes use the function
DoCmd.RunSQL - query, passing a valid SQL statement, but
everytime I do this, I get the following remark:

"You are about to modify/delete/etc...", waiting for the
user to reply.

How can I avoid this?

Thanks
mosquitooth
Cheryl gave you the CurrentDb.Execute solution, but to directly answer
your RunSQL method question....

DoCmd.SetWarnings False
DoCmd.RunSQL "etc"
DoCmd.SetWarnings True

Always remember to turn the Warnings on after you've turned them off.
 
Back
Top