Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate table with trapped error information

Status
Not open for further replies.

jojones

Programmer
Dec 4, 2000
104
AU
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 SOOOOOO SORRY!!!! As per usual, I get fed up with looking for solutions, make a post here and then figure out the solution.

I Do STILL NEED HELP with the error description though...

The error is actually a warning on an Append Query which tells me that I can't append all the records in the append query... the error then goes on to tell you what type of errors (type conversion, key violation) and how many records... this is what I want to get... any ideas?

THANKS THANKS THANKS
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top