Unexplained Error Message (1 Viewer)

lmcc007

Registered User.
Local time
Today, 12:52
Joined
Nov 10, 2007
Messages
635
Sometimes I get the below error message when I open a form; I can't figure out what causes it; I have to close, compact db, and reopen until it goes away.

The expression On Click you entered as the event property setting produced the following error: Object or class does not support the set of events.

  • The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
  • There may have been an error evaluating the function, event, or macro.


To highlight my row, I am using:

txtCurrentRecord =
txtBackground = IIf([EventID]=[txtCurrentRecord],String$(200,"g"),"")


Here is the code on that form:

Code:
Private Sub Form_Current()

On Error GoTo ErrorHandler
    
    Me!txtCurrentRecord = Me!EventID


CleanUpAndExit:
    Exit Sub

ErrorHandler:
    Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
        "Description:  " & Err.Description & vbCrLf & _
        "Error Number:  " & Err.Number, vbCritical, gstrAppTitle)
    Resume CleanUpAndExit

End Sub

Private Sub Form_Load()

On Error GoTo ErrorHandler
    
    DoCmd.MoveSize 4480, 1460
    
    If Not IsNull(Forms!frmViewEventHistoryList!ActivityType) Then
        Me!txtAppls = ActivityTotal(1)
        Me!txtAttachments = ActivityTotal(2)
        Me!txtConductJobFair = ActivityTotal(3)
        Me!txtCallsIncoming = ActivityTotal(19)
        Me!txtCallsOutgoing = ActivityTotal(20)
        Me!txtConductInterviews = ActivityTotal(8) + ActivityTotal(9) + ActivityTotal(10) + ActivityTotal(11)
        Me!txtMeeting = ActivityTotal(16)
        Me!txtNotes = ActivityTotal(17)
        Me!txtEvaluations = ActivityTotal(18)
        Me!txtPhoneSurvey = ActivityTotal(21)
        Me!txtPrep = ActivityTotal(22)
        Me!txtReceived = ActivityTotal(4) + ActivityTotal(6) + ActivityTotal(14)
        Me!txtCVS = ActivityTotal(23)
        Me!txtSearchedOnline = ActivityTotal(24)
        Me!txtSends = ActivityTotal(5) + ActivityTotal(7) + ActivityTotal(15)
        Me!txtTesting = ActivityTotal(25)
        Me!txtToDos = ActivityTotal(27)
        Me!txtTraining = ActivityTotal(28)
    End If
    

CleanUpAndExit:
    Exit Sub

ErrorHandler:
    Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
        "Description:  " & Err.Description & vbCrLf & _
        "Error Number:  " & Err.Number, vbCritical, gstrAppTitle)
    Resume CleanUpAndExit

End Sub


Any suggestions on getting rid of this problem?
 

RuralGuy

AWF VIP
Local time
Today, 11:52
Joined
Jul 2, 2005
Messages
13,825
What version of Access are you using and on what OS? Do you know what line is causing the problem? Do you have your system set to "Break on Unhandled errors"?
 

lmcc007

Registered User.
Local time
Today, 12:52
Joined
Nov 10, 2007
Messages
635
What version of Access are you using and on what OS? Do you know what line is causing the problem? Do you have your system set to "Break on Unhandled errors"?

Using Access 2007 on Vista. No, I don't know what line is causing the problem.

How do I tell it to "Break on Unhandled errors"? Are you saying to remove the error handling stuff from the all the code above?
 

RuralGuy

AWF VIP
Local time
Today, 11:52
Joined
Jul 2, 2005
Messages
13,825
Are you saying to remove the error handling stuff from the all the code above?
Not at all!
How do I tell it to "Break on Unhandled errors"?
Open any code module and then go to Tools>Options...>General Tab on the right side>Error Trapping
You can also try "Break on All Errors" to force the break.
 

lmcc007

Registered User.
Local time
Today, 12:52
Joined
Nov 10, 2007
Messages
635
Not at all!
Open any code module and then go to Tools>Options...>General Tab on the right side>Error Trapping
You can also try "Break on All Errors" to force the break.

Got it, thanks! And, the error doesn't happen all the time where I could pin point when and stuff.
 

RuralGuy

AWF VIP
Local time
Today, 11:52
Joined
Jul 2, 2005
Messages
13,825
That generally points to some "data sensitive" code. Verify your data are all valid.
 

lmcc007

Registered User.
Local time
Today, 12:52
Joined
Nov 10, 2007
Messages
635
Not at all!
Open any code module and then go to Tools>Options...>General Tab on the right side>Error Trapping
You can also try "Break on All Errors" to force the break.

Thanks again RuralGuy, this is a good tip. I have since found 4 errors--it went straight to the errors and I was able to figure them out.
 

RuralGuy

AWF VIP
Local time
Today, 11:52
Joined
Jul 2, 2005
Messages
13,825
Outstanding! That's news I like to hear. Thanks for posting back with your success.
 

Users who are viewing this thread

Top Bottom