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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The expression On Click you entered as the event property setting produced the following error: ..

Status
Not open for further replies.

ECHO Volunteer

IS-IT--Management
Mar 23, 2019
4
US
Access 2016 64bit, Windows 10 1809 PCs, Windows 2012R2 server
accde frontends saved on each PC, backend databases on the server
This error occurs for one application - this is a scheduling application with a master weekly schedule that is always open, other forms open and close from master form.
All VBA procedures have an On Error statement that traps and records errors, this error is not trapped
All On Click procedures have an On Error statement
All modules have an Option Explicit statement
Error occurs periodically for multiple users and PCs, no apparent pattern or user action before error occurs
 
Comment out the On Error statement, then run the code. It should show you the error and you will see where the code breaks.

Simian
 
So you have something like this:

Code:
...
On Error GoTo ErrorHandler
...
ErrorHandler:
???

Could you share what you have in ??? place?


---- Andy

There is a great need for a sarcasm font.
 
On Error GoTo Trap_Error
From = "Process Name"
... VBA code
Process_Exit:
Exit Sub

Trap_Error:
AccessErrorTable.AddNew
UserSignedIn =
DateOCcured =
ErrorCode =
LocFrom = From
ErrorDescription =
AccessErrorTable.Update
Resume Process_Exit
 
Hmmm, looks like a lot of missing data in your error handler:

Code:
Trap_Error:
AccessErrorTable.AddNew
UserSignedIn = [red]???[/red]
DateOCcured = [red]???[/red]
ErrorCode = [red]Err.Number[/red]
LocFrom = From
ErrorDescription = [red]Err.Description
Error Line = Erl[/red]
AccessErrorTable.Update

Yes, you could even have error line number (Erl) in your error handler if you put line numbers in your code. Wouldn't that be sweet? :)


---- Andy

There is a great need for a sarcasm font.
 
Clarification:
The Trap_Error code is actually:
Error_Number = Err.Number
Error_Descp = Err.Description
Record_Error
Resume Process_Exit

Error_Number, Error_Descp and From are Global variables

Public Sub Record_Error() - in global module
AccessErrorTable.Addnew
UserSignedIn =
Date =
ErrorCode = Error_Number
ErrorDescp = Error_Descp
CodeRef = From
AccessErrorTable.Update
Exit Sub

There are well over 200 On Click events on the main screen, mostly on subforms
 
UserSignedIn and Date are defined in the global module when the frontend application is initially opened then assigned to the table variables when the new record is added
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top