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

Error Object or class does not support the set of events

Status
Not open for further replies.

Lavenderchan

Technical User
Jul 21, 2008
132
US
Hi I was wondering if anyone would have a clue why I keep getting this error message. i have a macro on the on click event that opens a form in edit mode. If I open it and try to run the code it give me the above error message. If I edit the macro it will work only while I have the database open.Once I close it out and go back in it doesn't work. I have read up on this error message and I cannot figrue out why I'm getting it. Any clarifation would be help ful.
I have convert from a macro to vba code so i could paste the code here:
Private Sub Control_Number_Click()
On Error GoTo Control_Number_Click_Err

On Error Resume Next
If (Form.Dirty) Then
DoCmd.RunCommand acCmdSaveRecord
End If
If (MacroError.Number <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
Exit Sub
End If
On Error GoTo 0
DoCmd.OpenForm "Closed Correspondence Details", acNormal, "", "[ID]=" & Nz(ID, 0), acEdit, acDialog
If (Not IsNull(ID)) Then
TempVars.Add "CurrentID", "[ID]"
End If
If (IsNull(ID)) Then
TempVars.Add "CurrentID", "Nz(DMax(""[ID]"",[Form].[RecordSource]),0)"
End If
DoCmd.Requery ""
DoCmd.SearchForRecord , "", acFirst, "[ID]=" & TempVars!CurrentID
TempVars.Remove "CurrentID"


Control_Number_Click_Exit:
Exit Sub

Control_Number_Click_Err:
MsgBox Error$
Resume Control_Number_Click_Exit

End Sub

Thanks,
Keri
 
No I looked at the post earlier today. I'm using Access 2007. I've even looked at the Access options. Its only effecting this database. i have two that I use on a regular bases.
Keri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top