Snuggle Walrus
Member
- Local time
- Today, 00:08
- Joined
- May 14, 2020
- Messages
- 32
Hi everyone! I've tried searching the forum here and have been a fairly long time lurker but sadly i'm running into a bit of trouble understanding something i imagine is very basic for all of you experts
. I've been working on a database for sometime now nearly every day and am trying to add in some error handling in my forms. I understand using the On Error go to and how to display error messages ect and escaping the function if theres an error and have most of it in the correct order after reading through a bunch of posts! Now what i was trying to do was the table that hosts error messages similar to the Allen Browns code . I added the module and it liked everything got through the debug just fine but now i'm trying to call upon it when i encounter an error in my form but when i try to compile i get an error on the line saying "Compile error, expected variable or procedure not module"
Thats a snippet of my code (right at the bottom i've got bits above and my first line is On Error GoTo OPSYSError). Why cant i call on this module for the code that creates a table based on my error? am I doing something wrong? Thanks all any other advice on error handling would be fantastic! Have a lovely day!

Code:
OPSYSErrorExit:
Exit Sub
OPSYSError:
MsgBox Err.Number & Err.Description, vbCritical, "OPSYS Error"
Call LogOPSYSError(Err.Number, Err.Description, "Command21_Click()")
Resume OPSYSErrorExit
Thats a snippet of my code (right at the bottom i've got bits above and my first line is On Error GoTo OPSYSError). Why cant i call on this module for the code that creates a table based on my error? am I doing something wrong? Thanks all any other advice on error handling would be fantastic! Have a lovely day!