By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,149 Members | 885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,149 IT Pros & Developers. It's quick & easy.

access how to by pass an error

atksamy
P: 91
i have the following code
Expand|Select|Wrap|Line Numbers
  1.  
  2. On Error GoTo TableTest_Error
  3.  
  4.                    Set rs3 = CurrentDb.OpenRecordset(strsql3)
  5.  
  6.                   GoTo continue
  7.  
  8. TableTest_Error:
  9.                   If Err.Number = 3061 Then
  10.                     Call Err.Clear
  11.                     GoTo next_table
  12.                   Else
  13.                     MsgBox Err.Description ' or whatever you find appropriate '
  14.                   End If
  15.  
here in certain cases strsql3 will not execute as the field being got might not be there in table so i get error 3061,
i am trying to by pass the error but the error keeps popping at line no 4

thanks
Nov 10 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
This does not seem a well-thought out way to do things - trying to open a recordset when the fields of the recordset may not match - but as you have provided no detail of what you are trying to do we can't advise on better ways to do it.

Remove your current error-handling altogether, including the On Error statement. Use

On Error Resume Next

instead.

Please note that this will result in you not being notified you of any errors at all, at least not until you override that On Error statement with a different one.

-Stewart
Nov 10 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.