Expression After Update you entered as the property setting produced the following error (1 Viewer)

Bumpkin

Registered User.
Local time
Today, 13:22
Joined
May 31, 2015
Messages
18
This is a strange one. I have a database that has been working for literally years on a club win10 pc using Office Prof 2010.
Suddenly it is giving errors when some, but not all, a buttons are clicked. I wrote it on my pc and copied it to the club pc some years ago. I have checked the otiginal on my laptop and it is still fine Imade a new copy and put that on the club pc but the errors still occur. I have tried repairing Office and repairing the datbase with no result.
The error is Expression After Update you entered as the property setting produced the following error: "Object or class does not support the set of events"
Any ideas how to solve this mystery?
 
Could be Microsoft Office Update problem; which there have been a few lately. But more sounds like the class is setting a property from the AfterUpdate event, and there is no object variable WithEvents in there. Stick an object variable in there WithEvents as below which should remove this failsafe.
Usually that type of error would be down to the instantiation of the class object being declared & initiated in a single line (below). When an object handles events it must be declared in a single line & instantiated in another line.
Code:
Dim varName as clsType
Set varName = new clsType

Also in the cls itself there needs to be an object variable; I'm getting off-topic as you seem to have a standard 'After Update' event (not a user-declared event but it could be there is a similar named 'After Update' user-declared event:
Code:
Public Event theEventName(ParametersIfRequired As Long)

Code:
Dim varName as New clsType
And the user-declared event must be raised within that class.

Try Db Tools > Compact & Repair (don't think it will help) but try it for luck.
 
it's hard to troubleshoot with limited info.
 
Could be Microsoft Office Update problem; which there have been a few lately. But more sounds like the class is setting a property from the AfterUpdate event, and there is no object variable WithEvents in there. Stick an object variable in there WithEvents as below which should remove this failsafe.
Usually that type of error would be down to the instantiation of the class object being declared & initiated in a single line (below). When an object handles events it must be declared in a single line & instantiated in another line.
Code:
Dim varName as clsType
Set varName = new clsType

Also in the cls itself there needs to be an object variable; I'm getting off-topic as you seem to have a standard 'After Update' event (not a user-declared event but it could be there is a similar named 'After Update' user-declared event:
Code:
Public Event theEventName(ParametersIfRequired As Long)

Code:
Dim varName as New clsType
And the user-declared event must be raised within that class.

Try Db Tools > Compact & Repair (don't think it will help) but try it for luck.
I did try compact and repair but that made no difference.
The odd thing is that my version still works fine.
I haven'nt used any real coding, just a procedure behind a button on a form to decide which report to run.

Private Sub Command67_Click()

If Left(Me.Season, 3) = "Ind" Then
DoCmd.OpenReport "MnthlyHcapsIndoor", acViewPreview

ElseIf Left(Me.Season, 3) = "Out" Then
DoCmd.OpenReport "MnthlyHcapsoutdoor", acViewPreview

End If

End Sub
 
I don't think they update 2010 now so what I'm saying should be redundant. Is one a 32-Bit machine the other 64-bit?
 

Users who are viewing this thread

Back
Top Bottom