Supress 'Record is deleted.' warning

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.
 
R

Richard

Try something like this:

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

Larry Kahm

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.
 
T

Tom Wickerath

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.
 
R

Richard

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top