UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Query Run Defaults, Access 2016    
 
   
ccman69
post Sep 11 2019, 10:24 AM
Post#1



Posts: 458
Joined: 5-July 07



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?

--------------------
ccman69
Go to the top of the page
 
GroverParkGeorge
post Sep 11 2019, 10:28 AM
Post#2


UA Admin
Posts: 35,892
Joined: 20-June 02
From: Newcastle, WA


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.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
ccman69
post Sep 11 2019, 10:32 AM
Post#3



Posts: 458
Joined: 5-July 07



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".

--------------------
ccman69
Go to the top of the page
 
GroverParkGeorge
post Sep 11 2019, 10:36 AM
Post#4


UA Admin
Posts: 35,892
Joined: 20-June 02
From: Newcastle, WA


Same solution should work.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
arnelgp
post Sep 11 2019, 10:45 AM
Post#5



Posts: 1,475
Joined: 2-April 09
From: somewhere out there...


you can use Docmd to delete the table:

Docmd.DeleteObject actable, "TableName"

--------------------
Never stop learning, because life never stops teaching.
Go to the top of the page
 
ccman69
post Sep 11 2019, 12:45 PM
Post#6



Posts: 458
Joined: 5-July 07



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

--------------------
ccman69
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th October 2019 - 07:17 PM