After Del Confirm error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created an event procedure for the After Del Confirm event on a subform.
When I perform a delete on a record on that form, I receive the confirmation
that I am about to delete 1 record, click OK, and then receive the following
error message:

"The expression After Del Confirm you entered as the event property setting
produced the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control"

I cannot figure out what is causing the error. Thoughts?
 
It would be helpful to see the code you wrote for the event. There's
something in there that Access doesn't like.
 
The code is quite simple:


Private Sub Form_AfterDelConfirm(Status As Integer)
MsgBox "1"
Forms![Bids]![ListBoxOfVendors].Requery
MsgBox "2"
End Sub

The MsgBox's are just in there for debugging. It doesn't even make it to
the first MsgBox before the error. I did notiice when I went in to build the
code initially, there was a sub-proc named the same thing with no code in it,
like I had added an Event Procedure earlier but then removed it from the form
property but didn't actually delete the sub-proc definition. That may have
something to do with it. But if it does, I don't know how to resolve the
issue.
 
Must have been something funky in the form. I imported all of the objects
into a new database and that fixed it. Must have "reset" something when I
did the import.

Transient said:
The code is quite simple:


Private Sub Form_AfterDelConfirm(Status As Integer)
MsgBox "1"
Forms![Bids]![ListBoxOfVendors].Requery
MsgBox "2"
End Sub

The MsgBox's are just in there for debugging. It doesn't even make it to
the first MsgBox before the error. I did notiice when I went in to build the
code initially, there was a sub-proc named the same thing with no code in it,
like I had added an Event Procedure earlier but then removed it from the form
property but didn't actually delete the sub-proc definition. That may have
something to do with it. But if it does, I don't know how to resolve the
issue.

Mark said:
It would be helpful to see the code you wrote for the event. There's
something in there that Access doesn't like.
 
Back
Top