Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / June 2005

Tip: Looking for answers? Try searching our database.

Access: How to supress those "You are about to update..." warnings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Monty - 13 Jun 2005 20:28 GMT
I have an updated query attached to the "on close" event of a form in Access.
But now, before Access allows me to close the form, I get a warning that the
query is about to run and that "x" number of records will be changed.

How do I turn off this irritating warning/
Dirk Goldgar - 13 Jun 2005 20:43 GMT
> I have an updated query attached to the "on close" event of a form in
> Access. But now, before Access allows me to close the form, I get a
> warning that the query is about to run and that "x" number of records
> will be changed.
>
> How do I turn off this irritating warning/

Does your form use DoCmd.RunSQL or DoCmd.OpenQuery to run the query?  If
so, you can replace that line with one like this:

   CurrentDb.Execute "YourQueryNameOrSQL", dbFailOnError

The only problem with that would be if you query uses a reference to a
control on a form.  In that case, the above won't work, and you would do
better to use code like this:

   Private Sub Form_Close()

       On Error GoTo Err_Handler

       DoCmd.SetWarnings False
       DoCmd.OpenQuery "YourQueryName"

   Exit_Point:
       DoCmd.SetWarnings True
       Exit Sub

   Err_Handler:
       MsgBox Err.Description, vbExclamation, "Error " & Err.Number
       Resume Exit_Point

   End Sub

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Ofer - 13 Jun 2005 21:23 GMT
Put the code
docmd.SetWarnings false
before running the query, that will turn off this irritating warning
and after running the query change it back to  true
docmd.SetWarnings True

> I have an updated query attached to the "on close" event of a form in Access.
> But now, before Access allows me to close the form, I get a warning that the
> query is about to run and that "x" number of records will be changed.
>
> How do I turn off this irritating warning/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.