PC Review


Reply
Thread Tools Rate Thread

Delete not triggering event?

 
 
Judy
Guest
Posts: n/a
 
      18th Jul 2003
I have a subform in datasheet view. When the user deletes
a row from the subform I want some code to execute. I
have not been able to figure out what event to use. I
have put debug messages in several form events and none of
them are being triggered by the delete
(Form_AfterDelConfirm, Form_AfterUpdate,
Form_DataChange). I have also tried an event for the
field that is being deleted (txtPrjctStBgnDt_AferUpdate).

Can anyone help me figure out where to put my code to get
it to execute after a delete?

Thank you,
Judy
 
Reply With Quote
 
 
 
 
Bruce M. Thompson
Guest
Posts: n/a
 
      18th Jul 2003
> I have a subform in datasheet view. When the user deletes
> a row from the subform I want some code to execute. I
> have not been able to figure out what event to use. I
> have put debug messages in several form events and none of
> them are being triggered by the delete
> (Form_AfterDelConfirm, Form_AfterUpdate,
> Form_DataChange). I have also tried an event for the
> field that is being deleted (txtPrjctStBgnDt_AferUpdate).


The AfterDelConfirm event should be triggered - I use it frequently. Here is
an example of the code in such a procedure that runs code after a record has
been deleted:

'******************EXAMPLE START
Private Sub Form_AfterDelConfirm(Status As Integer)
Select Case Status
Case acDeleteOK
'The code runs here if record was deleted
MsgBox "The record was deleted."
End Select
End Sub
'******************EXAMPLE END

--
Bruce M. Thompson, Microsoft Access MVP
(E-Mail Removed) (See the Access FAQ at http://www.mvps.org/access)
>>No Email, Please. Keep all communications

within the newsgroups so that all might benefit.<<


 
Reply With Quote
 
Judy
Guest
Posts: n/a
 
      18th Jul 2003
I copied your exact code into the code module for my
subform. The row was deleted from the table, but the
MsgBox did not pop up. Can you think of any reason why
this might be happening or is there anything else I can
try?

Thank you,
Judy

>-----Original Message-----
>> I have a subform in datasheet view. When the user

deletes
>> a row from the subform I want some code to execute. I
>> have not been able to figure out what event to use. I
>> have put debug messages in several form events and none

of
>> them are being triggered by the delete
>> (Form_AfterDelConfirm, Form_AfterUpdate,
>> Form_DataChange). I have also tried an event for the
>> field that is being deleted

(txtPrjctStBgnDt_AferUpdate).
>
>The AfterDelConfirm event should be triggered - I use it

frequently. Here is
>an example of the code in such a procedure that runs code

after a record has
>been deleted:
>
>'******************EXAMPLE START
>Private Sub Form_AfterDelConfirm(Status As Integer)
> Select Case Status
> Case acDeleteOK
> 'The code runs here if record was deleted
> MsgBox "The record was deleted."
> End Select
>End Sub
>'******************EXAMPLE END
>
>--
>Bruce M. Thompson, Microsoft Access MVP
>(E-Mail Removed) (See the Access FAQ at

http://www.mvps.org/access)
>>>No Email, Please. Keep all communications

> within the newsgroups so that all might benefit.<<
>
>
>.
>

 
Reply With Quote
 
Judy
Guest
Posts: n/a
 
      18th Jul 2003
I found out why the event is not being triggered. Under
Tools --> Options --> Edit/Find tab --> Confirm --> Record
Changes is not checked in my Access application.

I can check this box in my application, but what if the
user does not have this box checked (the code would not
get executed)? Any suggestions?

Thank you for your help,
Judy

>-----Original Message-----
>> I have a subform in datasheet view. When the user

deletes
>> a row from the subform I want some code to execute. I
>> have not been able to figure out what event to use. I
>> have put debug messages in several form events and none

of
>> them are being triggered by the delete
>> (Form_AfterDelConfirm, Form_AfterUpdate,
>> Form_DataChange). I have also tried an event for the
>> field that is being deleted

(txtPrjctStBgnDt_AferUpdate).
>
>The AfterDelConfirm event should be triggered - I use it

frequently. Here is
>an example of the code in such a procedure that runs code

after a record has
>been deleted:
>
>'******************EXAMPLE START
>Private Sub Form_AfterDelConfirm(Status As Integer)
> Select Case Status
> Case acDeleteOK
> 'The code runs here if record was deleted
> MsgBox "The record was deleted."
> End Select
>End Sub
>'******************EXAMPLE END
>
>--
>Bruce M. Thompson, Microsoft Access MVP
>(E-Mail Removed) (See the Access FAQ at

http://www.mvps.org/access)
>>>No Email, Please. Keep all communications

> within the newsgroups so that all might benefit.<<
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggering a Control Event Jeff Tolman Microsoft Dot NET Framework Forms 3 19th Sep 2005 11:58 PM
Triggering activesync event =?Utf-8?B?UGV0ZXIgU2NobWl0eg==?= Microsoft Dot NET Compact Framework 4 6th Apr 2005 04:20 PM
event triggering e-mail Jules Microsoft Access VBA Modules 2 11th May 2004 07:31 PM
Triggering an event David S. Microsoft Access VBA Modules 3 19th Apr 2004 12:41 AM
Re: Triggering an event Woody Splawn Microsoft VB .NET 1 25th Aug 2003 07:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:09 AM.