Avatar of MDauphinais1
MDauphinais1
 asked on

Microsoft Access Update Query without Notification Prompt

Is it possible to run an update query from a form without that prompt coming up that asks you to confirm Yes or No?
Microsoft Access

Avatar of undefined
Last Comment
jadedata

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
jadedata

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
jadedata

you can swap a string variable with an sql string in it for the query name in the command line
MDauphinais1

ASKER
This is the query statement I have...

DoCmd.RunSQL ("UPDATE [Dashboard Configuration], [File Cabinet] SET [Dashboard Configuration].QuickLink1Link = [File Cabinet].[DocPath], [Dashboard Configuration].QuickLink1Text = [File Cabinet].[DocName] WHERE ((([File Cabinet].ID)=1));")

Where would I put that statement?
mpmccarthy

DoCmd.SetWarnings False

This will turn off all warnings, don't forget to set it back to true to turn them back on

DoCmd.SetWarnings True
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
jadedata

put your sql statement in where "NameOfQuery" is in mine

then replace yours in the code with the modified line
rockiroads

If your DB is local to you i.e. u just run it then u can set the options
go to tools/options
go to Edit/Find
go to confirm section
then uncheck all 3
otherwise u have to do it on code as shown by the previous posts
MDauphinais1

ASKER
Awesome, thank you.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
jadedata

for db's outside the local...

dim xdb as database
set xdb = dbengine.opendatabase("Path to and name of a database")
xdb.execute "An sql where the tables are local to the database name above", dbfailonerror

{thanx for the reminder rocki!}