Dealing with warnings from append queries

BillNorton

Registered User.
Local time
Today, 18:35
Joined
May 23, 2001
Messages
27
I have a process that runs a bunch of Append queries. When Warnings are on you will get a message saying something like "You are about to append X rows? Do you want to continue?" If there is a problem with the append you will get a second message saying "<Your app> can't append all the records. Of these problems X were because of key violation, Y were because of lock violations, etc."

I don't want to bother the user with the first warning, but I do want to notify them about the second, because that indicates there is a real problem. On Error doesn't work because it's not an error - just a warning.

Any ideas?

Bill Norton
Austin, TX
 
At the beginning of your module try using the line:
Application.SetOption "confirm action queries", 0

and then the line:
Application.SetOption "confirm action queries", 1 at the end of the module. I'm not positive whether that will still work if there is an error but it will turn off the confirmation.
 
Two possibles I see.

1. Set Warnings = False before all of the Queries.
Set Warnings = True after all of the Queries.

2. Use the CurrentDB.Execute Method.

Dim db as DAO.Database
Set db = CurrentDB
db.Execute "Your Action Query Name Here or the SQL equivelant of an Action Query"
 

Users who are viewing this thread

Back
Top Bottom