I am using VBA to insert some data into a table should the appropriate record exist on a different table.
I am opening and closing a Recordset to retrieve record values which loops until it gets to the end of the file.
It goes through the entire loop fine, creates files etc., however, it seems to catch an error at the end and no matter what I try I can't seem to figure out what is causing it!
I have included the basics of the code...any help on this would be very much appreciated.
Thanks a lot
Re: Error Line: 0 / Error: (0)...What is my error??
Hack's got it right, and a few more things:
1) the On Error Goto needs to be the first line in the sub
2) There is no error. Your lack of Exit Sub before the error handler causes the code in the error handler to run
3) You will always get 0 for the Erl even when there is an error. That's because you have no line numbers in the sub.
Re: Error Line: 0 / Error: (0)...What is my error??
Aaah, I see. I didn't realise that the code executes even if no error is thrown. Thought it was like a basic try-catch statement.
Excellent to know.
Thanks a lot guys, you've been very informative.