Put mutliple DoCmd.RunSQL lines into a transaction?


In my VBA code, I have these two statement to call the linked Oracle table (in Access):

DoCmd.RunSQL "Update ... table1"
DoCmd.RunSQL "Update ... table2"

system will pop up a message to ask you to confirm that "the record will be changed".

My question are:
1. how to disable this kind of confirmation message?
2. How to set up transaction in VBA to make sure the two statements are executed together? Any sample code will be appreciated. Thanks.
heyday2004Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tbsgadiCommented:
Hi heyday2004,

1. In your code add DoCmd.SetWarnings False before the updates & DoCmd.SetWarnings True after
2. For transactions you might be better off creating a stored procedure in Oracle


Good Luck!

Gary
0
tbsgadiCommented:
heyday2004,
Have a look at this
http://vb123.com/toolshed/99_accvb/transactions.htm

Gary
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
heyday2004Author Commented:
Thanks. For question 2, i know stored procedure is the best, but for some reason, I couldn't use that for now. I am wondering how much risk it is to call several lines of DoCmd.RunSQL to update the record. thanks.
0
tbsgadiCommented:
So try out my second posting
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.