Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Queries _ Query Run Defaults

Posted by: ccman69 Sep 11 2019, 10:24 AM

I have noticed with some of the queries I have built, that when clicked to run, some will request confirmation with default answer "Yes" and others will default to "No". I have multiple queries that run back to back and I simply hit the <Enter> key to run through the process quickly instead of using the mouse to click the "Yes" button for each conformation to run. I have thought about using "DoCmd.SetWarnings" = false method, but my concern is if the query that defaults to No will not run automatically. Is there a way to default the query to run with the default set to Yes without the warnings?

Posted by: GroverParkGeorge Sep 11 2019, 10:28 AM

There is a different way to execute action queries (update, insert, delete)

CurrentDB.Execute "YourQueryNameGoesHere", DBFailOnError

That executes the SQL immediately, but does raise a trappable error if one occurs.

Posted by: ccman69 Sep 11 2019, 10:32 AM

Sorry for the confusion. I just discovered that my real issue is in the delete query. I need the "Existing table will be deleted", "Do you want to continue anyway?" to default to "yes".

Posted by: GroverParkGeorge Sep 11 2019, 10:36 AM

Same solution should work.

Posted by: arnelgp Sep 11 2019, 10:45 AM

you can use Docmd to delete the table:

Docmd.DeleteObject actable, "TableName"

Posted by: ccman69 Sep 11 2019, 12:45 PM

I thank you both for the Replies. I shall try them.