Supress 'Record is deleted.' warning

  • Thread starter Thread starter macroapa
  • Start date Start date
M

macroapa

Hi, I have some VBA code which deletes records from a table.

The code works fine, but at the end I get a warning with an OK button
with the message 'Record is deleted'.

Is there a way to surpress this message?

I have tried the following, but no joy.

DoCmd.SetWarnings False
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False

Thanks.
 
Try something like this:

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE TableName SET [FieldName] = False;"
DoCmd.SetWarnings True
Me.Requery
 
Or, to avoid the SetWarnings altogether, use something like this:

strSQL = "DELETE * FROM TableName WHERE RecordID = " & lngRecordID
CurrentDb.Execute strSQL, dbFailOnError

Larry

Richard said:
Try something like this:

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE TableName SET [FieldName] = False;"
DoCmd.SetWarnings True
Me.Requery


macroapa said:
Hi, I have some VBA code which deletes records from a table.

The code works fine, but at the end I get a warning with an OK button
with the message 'Record is deleted'.

Is there a way to surpress this message?

I have tried the following, but no joy.

DoCmd.SetWarnings False
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False

Thanks.
 
Here is a Word document summary of several methods, including the .execute
method:

http://www.accessmvp.com/TWickerath/downloads/ActionQueryExamplesWithSetWarnings.doc


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________


Larry Kahm said:
Or, to avoid the SetWarnings altogether, use something like this:

strSQL = "DELETE * FROM TableName WHERE RecordID = " & lngRecordID
CurrentDb.Execute strSQL, dbFailOnError

Larry

Richard said:
Try something like this:

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE TableName SET [FieldName] = False;"
DoCmd.SetWarnings True
Me.Requery


macroapa said:
Hi, I have some VBA code which deletes records from a table.

The code works fine, but at the end I get a warning with an OK button
with the message 'Record is deleted'.

Is there a way to surpress this message?

I have tried the following, but no joy.

DoCmd.SetWarnings False
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False

Thanks.
 
This link address the question also:

http://www.mvps.org/access/queries/qry0012.htm



Larry Kahm said:
Or, to avoid the SetWarnings altogether, use something like this:

strSQL = "DELETE * FROM TableName WHERE RecordID = " & lngRecordID
CurrentDb.Execute strSQL, dbFailOnError

Larry

Richard said:
Try something like this:

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE TableName SET [FieldName] = False;"
DoCmd.SetWarnings True
Me.Requery


macroapa said:
Hi, I have some VBA code which deletes records from a table.

The code works fine, but at the end I get a warning with an OK button
with the message 'Record is deleted'.

Is there a way to surpress this message?

I have tried the following, but no joy.

DoCmd.SetWarnings False
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False

Thanks.
 
Back
Top