Kayleigh
Member
- Local time
- Today, 14:35
- Joined
- Sep 24, 2020
- Messages
- 706
Hi,
I am working on tidying up a large database so it is suitable for consumer use. Part of the process is embedding error trapping into all code. I can do with some advice on this please.
I found this post quite useful. But a few questions I have:
1. Any advice on cleanup code (e.g. close rs/db) for exit?
2. What common errors to accommodate?
3. Is it really necessary to log every error that occurs?
4. When would 'on error resume next' be suitable?
This is my generic code for reference:
I am working on tidying up a large database so it is suitable for consumer use. Part of the process is embedding error trapping into all code. I can do with some advice on this please.
I found this post quite useful. But a few questions I have:
1. Any advice on cleanup code (e.g. close rs/db) for exit?
2. What common errors to accommodate?
3. Is it really necessary to log every error that occurs?
4. When would 'on error resume next' be suitable?
This is my generic code for reference:
Code:
On Error GoTo Err_SubName
//Sub Code
Exit_SubName:
Exit Function
Err_SubName:
MsgBox Err.Description, vbExclamation, "SubName Error " & Err.Number
Resume Exit_SubName