Link to home
Start Free TrialLog in
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?
ASKER CERTIFIED SOLUTION
Avatar of jadedata
jadedata
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can swap a string variable with an sql string in it for the query name in the command line
Avatar of MDauphinais1
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?
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
put your sql statement in where "NameOfQuery" is in mine

then replace yours in the code with the modified line
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
Awesome, thank you.
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!}