exaclty this,
I was using resume next but in order to resume not next, I was using "go to" + the label
I replaced go to with with resume ....
and is working
thank you very much John
2015-06-27 9:36 GMT+02:00 John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>:
Valentino-
For the code to keep running, you have to use Resume. I assume you want to pick up execution at somewhere other than "Next". The way to do that is to consecutively number your lines of code and then use Resume LineNo to clear the error and go to where you want to keep processing.John Viescas, AuthorMicrosoft Access 2010 Inside OutMicrosoft Access 2007 Inside OutMicrosoft Access 2003 Inside OutBuilding Microsoft Access ApplicationsSQL Queries for Mere Mortals(Paris, France)
On Jun 27, 2015, at 9:19 AM, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:Good morning,I have one issue with error procedureThere is one function (number 1) that call the function number 2 giving it two variablesIn function number 2 there is an error procedure:At the beginning there is this line that call the error procedure
"On Error GoTo errhandler"
At the end of this mail there is written the error procedure
The function 2 read a table using do loop cycle where is written the path where find many excel sheet to be imported using the command:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, destable, filenamefinale, False, des & "!"
The case "case 3125" appear when the name of the file that is in the table that the do loop cycle read, is not found in excel sheetThe procedure tell to the operator that the sheet there Is not in the file and go to the end of the loop to read next sheet.effectively the error procedure is working the first time the procedure find this issue and bypass it going on to the next, but going on reading using the doo loop cycle, one time that find another error with the same code 3125, it look like the error procedure is not anymore working and the program stop showing the error 3125 as if the error procedure is not active.My goal is that each time one sheet Is not find bypass it, but actually this occur only the first time.
Somebody have some idea why occur this issue and how to solve?Thank you to all
Valentino
errhandler:Select Case Err
Case 2391
db.TableDefs.Delete destableResumeCase 3078:
varia = 1Err.ClearResume Next
Case 3125MsgBox "I do not find the sheet named " & des & "This Sheet will be bypassed"varia = 0Err.Clear
GoTo fine
Case Else:MsgBox "Error # " & Err & " : " & Error(Err)
End Select
__._,_.___
Posted by: Valentino Avvisati <valentino.avvisati@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar