Update Warnings

johncollier1

Registered User.
Local time
Today, 15:55
Joined
Mar 17, 2013
Messages
17
Is it possible to disable the dialogue box warnings you get when you run an update query
I’d like to be able to update tables without the end user having to OK the changes or even know that an update has occurred?
:rolleyes:
 
Hello johncollier1, What method are you using to Update? Based on your description, I think you are using DoCmd.RunSQL.. If so you can set the warnings off.. but make sure you turn them on immediately..
Code:
DoCmd.SetWarnings False
DoCmd.RunSQL ("yourSQLQuery")
DoCmd.SetWarning True
However, I would use CurrentDB.Execute.. More efficient and does not use the code to set warnings off and on..
 
Last edited:
I suppose it matters what type of a query you are talking about.

I see no such warnings using DAO.QueryDef objects or ADO objects to perform updates.

Here are some posts which might be helpful in the types of queries I speak of:

Example of SQL INSERT / UPDATE using ADODB.Command and ADODB.Parameters objects to Access tables
http://www.access-programmers.co.uk/forums/showthread.php?t=219149

Example of SQL SELECT using ADODB.Command and ADODB.Parameters objects to Access tables
http://www.access-programmers.co.uk/forums/showthread.php?t=230610#post1176746

My only post of a DAO.QueryDef is a bit complicated in that it is a nested QueryDef situation to transfer Pass-Through SQL to the remote DB server and then download the record(s) to a FE table. Still, it is a valid example of how to use a DAO.QueryDef object.

Example of DAO.QueryDef objects downloading records from a SQL BE DB via Pass-Through query and populating a FE temp table with them
http://www.access-programmers.co.uk/forums/showthread.php?p=1119605#post1119605

I recall hearing of warning messages popping up using other type of query capabilities in Access / VBA. These all work without any such warning.
 
Thanks Guys
I like the little code snippet, didn't no you could do that

Ill use that one all a lot

Regards
 
Hello johncollier1, What method are you using to Update? Based on your description, I think you are using DoCmd.RunSQL.. If so you can set the warnings off.. but make sure you turn them on immediately..
Code:
DoCmd.SetWarnings = False
DoCmd.RunSQL ("yourSQLQuery")
DoCmd.SetWarning = True
However, I would use CurrentDB.Execute.. More efficient and does not use the code to set warnings off and on..

The TRUE/FALSE in the command is an argument. There should be no equal sign in the statement, i.e.
Code:
DoCmd.SetWarnings True   '....or False

Best,
Jiri
 
Hi
the SQL call is what Im doing
this code is just what I need

thanks for the help:)
 

Users who are viewing this thread

Back
Top Bottom