DoCmd.RunSQL question

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
 
C

Cheryl Fischer

Try ...

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

hth,
 
F

fredg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top