Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress Confirm in Append Queries 2

Status
Not open for further replies.

sawilliams

Technical User
Aug 23, 2006
98
US
I have two queries pulling data from two tables. First pulls Money Pledged. Second pulls installments paid on the Pledge. I have a table that these append queries write to. Later, I use this table to query and perform subtotals, etc. It's very complex and a bit difficult to explain so let me cut to the chase. I need to be able to have the user run the two queries to update the table but I don't want them to see the confirm message when records cannot be added due to key violations. There should be key violations, because I don't want the same record added twice. But when the user sees the scary key violation error, they get confused as to how to proceed. So, in Tools/Options/Edit-Find I have Confirm Action Queries unchecked but the key violation warning is not suppressed. Any idea how to do this?
 
Perhaps this ?
DoCmd.SetWarnings False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV:

The simplest answers are usually the most clever. You have solved my crisis. Thanks!

 
Alternatively:
Code:
Dim SQLText as String
SQLText = "INSERT INTO ..."

CurrentDb.Execute SQLText, dbFailOnError

This way you do not have to
DoCmd.SetWarnings = False
...
DoCmd.SetWarnings = True

~Melagan
______
"It's never too late to become what you might have been.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top