RE: Cancel Error Message and resume

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yeah, he could do that. But why not just:

recSet.Open "delete * from [table] where [key] = " & value

in VBA? All done. No error traps needed.


"Daniel" wrote:

run your code and remeber the error number being raised and replace the xxxx
with it in the following code

On error got Err_Handler

Your code

Err_Hanlder
If err.number<>xxxx then
msgbox err.num & vbcrlf & err.description
End if
Resume Next

checkout http://www.cardaconsultants.com/en/msaccess_vba.html it covers
error handling a little bit.

Daniel




"Wes" wrote:

Hello,

Hope you are doing well.

I have code written that outputs a table and then opens the table that
was output, selects all records, and deletes the records. The problem
is, if there are no records in the table, the code errors and stops.
Is there script I can add that will ignore the error and resume the
code?

Thanks.


.



Relevant Pages

  • Re: Reading a .txt file
    ... Yeah I can insert the variables into the table... ... I'm looking for a starting point to get vba to read a set of variables ... Doug Robbins - Word MVP ... script that will read variables from a .txt file (output from another ...
    (microsoft.public.word.vba.general)
  • Re: Using a total count in a query
    ... Yeah, I was trying to do it without going into VBA. ... I haven't messed with the object model in a long while, ... >> where the query doing the totalling is called Total Required, ...
    (microsoft.public.access.queries)
  • Re: Help getting a socket to work?
    ... Andy / Daniel - ... yeah, very well could be. ... >This blocks untill: ...
    (comp.lang.php)
  • RE: email verifier
    ... There is no way using some code (vba, ... Daniel P ... "bindurajeesh" wrote: ... bounce back as no longer in existence. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Daten ueber Formular in tabelle eingeben
    ... Daniel Wintersdorf schrieb am 22.09.2005 ... Ohne VBA ist ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.excel)