Expression After Update you entered as the property setting produced the following error (3 Viewers)

Bumpkin

Registered User.
Local time
Today, 15:01
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?
 
This might be a data error, for instance, a field you expect to contain a value is actually null. When processing the report (so only some reports for only some sets of data) the null causes an unhandled error, which bubbles up the call stack, and manifests as a failure in a higher level procedure. It works on your machine because you don't have the data file with the unexpected null.

Anyway, I've had the case where I'm looking for an error is the code, but the error is actually in the data (and of course not handled correctly in code).
 
I agree with MarkK. If you can, open the tables referenced by the form, sort each column high to low, low to high noting any null values.
 

Users who are viewing this thread

  • Back
    Top Bottom