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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete message

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
In my delete code i have get the message "record is deleted" even though i have put set warning to False.How can i avoid this mesage and why do i receive it ? I

DoCmd.SetWarnings
Dim StrSQL As String
DoCmd.SetWarnings False
StrSQL = "DELETE * FROM TblClients WHERE ClientID = " & Me.Clientid
CurrentDb.Execute StrSQL, dbFailOnError
Me.Requery
 
You are getting the message because you are using the [red]dbFailOnError[/red] parameter which causes the JET engine to report errors.

DoCmd.SetWarnings False applies only to Access messages and doesn't affect the JET Engine. Remove that parameter and the query will run (or fail) silently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top