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

Throwing errors

Status
Not open for further replies.

tmorita

Technical User
Jul 31, 2001
18
US
DoCmd.RunCommand acCmdDeleteRecord

When I step through my code and it hits this line of code Access thorws an error. The error is handled and it doesn't seem to affect my program. Is it normal for errors to be thrown and it having no impact on the performance of the program?
 

Throws and error? Error is handled? But doesn't impact the program performance? What sort of error are you seeing? Does the delete statement work? Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Yes! The delete command works. This is what I am so confused about. I am working in a very complicated Access program and making modifications. When I step through the code, errors are thrown occasionally but they don't impact the program. It is very strange and I am wondering if anyone else has ever come accross this.
 

I suspect that it is really not displaying an error message but is displaying a warning message like "You are about to delete 1 record(s)." You can eliminate that message by turning off warning messages rather than handling them in error handling code. Add the following line before at the beginning of the module.

DoCmd.SetWarnings (False)

Add the next line at the end.

DoCmd.SetWarnings (True) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top