Hi,
I am using in the first part of my program
on error go to start
suppose in my second part i am again using
on error resume next
this second error trap will not get activated as teh first one will be still active.Is there any way to de activate the first error after it is used. Hope I am clear
Set objexcel = CreateObject("excel.Application")
objexcel.Visible = True
On Error GoTo Openwb
wbExists = False
Set wbexcel = objexcel.Workbooks.Open("C:\REPORT3.xls")
Set objSht = wbexcel.Worksheets("Sheet1")
objSht.Activate
wbExists = True
Openwb:
On Error GoTo 0
If Not wbExists Then
objexcel.Workbooks.Add
Set wbexcel = objexcel.ActiveWorkbook
Set objSht = wbexcel.Worksheets("Sheet1")
End If
On Error GoTo 0
Set db = DBEngine.opendatabase("C:\book.mdb")
Set rs = db.OpenRecordset("records")
Set rs2 = CreateObject("ADODB.Recordset")
rs2.ActiveConnection = CurrentProject.Connection
For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
rs.MoveFirst
strsql = "SELECT * From [" & tdf.Name & "] WHERE s=15 "
Do While Not rs.EOF
On Error Resume Next
rs2.Open strsql
ON execution of last statement i wantto ignore the error and move on to next table but error handling does not seem to work
thanks