Sep 29 2009

Comment by Seth Spearman on MS Access VB call to Lib “kernel32″ fails to stop a process

Phil have you stepped through it? What happens?
Sep 29 2009

Comment by Seth Spearman on Access: Canceling Report generation causes error 2501

One last thing...ECHO False PREVENTS screen refreshes...so when I say you have to be careful I mean you have to absolutely ensure that Echo is set to True at some point. You should only use Echo if your code or macros are doing a lot of things that will cause the screen to jump and flash etc.
Sep 29 2009

Answer by Seth Spearman for Access: Canceling Report generation causes error 2501

Ditto to Phillipe's answer. you didn't give us the whole procedures but you need to do something like this...

Sub MyButton_Click
On Error Goto myError

DoCmd.OpenReport vBerichtName, nAnsicht


MyExit:
   Exit Sub

MyError:
   If Err.number = 2501 then goto myExit
   msgbox err.description
   goto myExit

End Sub

This is a common error but you can catch it like any other error and ignore it if is 2501.
Seth