Hi all
I am running a procedure without warnings and want to know if any errors occur whilst running this procedure. Ideally I would like to be able to insert the errors that occur into a table with a new record for each error instance. The table would look something like:
ErrNum ErrDesc Step ErrDate
1546 Validation errors 3 12/3/2002
6498 ........ 5 12/3/2002
you get the picture.
I have set up my sub procedure as (for example)
Sub MyProc()
Dim Step as Integer
On Error GoTo ErrorLogging
DoCmd.SetWarnings False
Step = 1
Step1
Step = 2
Step2
Step = 3
Step3
Step = 4
Step4
Step = 5
Step5
DoCmd.SetWarnings True
ErrorLogging:
'Here is where I want to insert the Err.Number,
'Err.Description, Step and Date (Now()) into my
'tblErrors.... not sure how to do it.
'OpenRecordset("tblErrors" etc..??? help.
End Sub
Can anyone help me?
I hope I have included all the information you need.
thanks loads
Jo
I am running a procedure without warnings and want to know if any errors occur whilst running this procedure. Ideally I would like to be able to insert the errors that occur into a table with a new record for each error instance. The table would look something like:
ErrNum ErrDesc Step ErrDate
1546 Validation errors 3 12/3/2002
6498 ........ 5 12/3/2002
you get the picture.
I have set up my sub procedure as (for example)
Sub MyProc()
Dim Step as Integer
On Error GoTo ErrorLogging
DoCmd.SetWarnings False
Step = 1
Step1
Step = 2
Step2
Step = 3
Step3
Step = 4
Step4
Step = 5
Step5
DoCmd.SetWarnings True
ErrorLogging:
'Here is where I want to insert the Err.Number,
'Err.Description, Step and Date (Now()) into my
'tblErrors.... not sure how to do it.
'OpenRecordset("tblErrors" etc..??? help.
End Sub
Can anyone help me?
I hope I have included all the information you need.
thanks loads
Jo