After recently adding some new VBA code that referred to a control, my code wouldn't run. On investigation, I found the problem was a typo in the code referring to the control: I'd typed it as Me.CheckYearEmd (with an m) rather than Me.CheckYearEnd.
This is now resolved and the code's working fine, but the weird thing is the error didn't trigger my error handling; it just didn't run. My error handling works on a very simple basis:
On Error GoTo ErrHandler
... 'Rest of sub
Exit Sub
ErrHandler:
DoCmd.SetWarnings True
MsgBox "The database has generated an error. Please contact the database administrator, quoting the following error message: '" & Err.Description & "'", vbCritical, "Database Error"
Is there something specific about referring to a control that doesn't exist (as I effectivley did above) that causes it to bypass error handling, and is there a way of catching these errors?