Full Version: Table Update Notice
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
rfritter
I've created several processes (subs) and execute them in 1/2 dozen steps. At the end of the process, I update a control table with the date of the last execution of this string. As a result of the update, a warning message is created that pops up and waits for a reply.

When testing is completed, this process will execute over the week end and so this warming message must be turned off. I know how to turn it off using the pull-down menus but have not been able to find how to turn it off using VBA.

Would someone please help!!

Thanks
dashiellx2000
Turn off the warnings with:

DoCmd.SetWarnings False

Then to turn them back on:

DOCmd.SetWarnings True

HTH.
freakazeud
Hi,
you should avoid to turn warnings off. Instead you should execute your statement/query with this:

CurrentDb.Execute "statement/query",dbFailOnError

HTH
Good luck
rfritter
dashiellx2000, wow, thats simple.

Looked in a lot of places but didn'l look in the DoCmd

thanks
dashiellx2000
You are welcome, but I would point to Freakazeud's post the the CurrentDb.Execute method is probably better. I stopped using SetWarnings and use the method he suggests myself.
rfritter
In order to use the command, CurrenDt.Execute, am I correct in assuming that I would need to establish an DAO object to connect to the DB?
rfritter
CurrentDb!!
dashiellx2000
Yes, that is correct:

Dim db as DAO.Database

Set db = CurrentDb()

db.Execute = SQL String.

HTH.
niesz
Check out Cheeky's comments about DAO/ADO execution in this thread...
rfritter
Thanks

Just to clarify, to this point I've not being using VB only VBA, were on the same page, right?? I've not been using DAO, so will have to do some thinking and reading about how to hook everythig together.

Needed to learn it anyway; was just hoping to put it off awhile.
Thanks
niesz
Just to clarify...

VB is not part of Access---only VBA. Sometimes people here refer to the code page in Access as VB. This is VBA.

DAO is not necessary to do what you are wanting. You can use native ADO.

CurrentProject.Connection.Execute strSQL
rfritter
niesz, thanks very much for the clarification. Very helpful. Thanks to all for your responces and willing to be helpful.
niesz
Glad we could help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.