Rabu, 15 Agustus 2012

[MS_AccessPros] Re: How to use vb to do something if a record is deleted

 

Connie

Let's assume that by "datasheet" you mean a form and not a table in datasheet view.

Forms have an AfterDelConfirm event. That is triggered when a user selects a row and deletes it. A confirmation message pops up saying "Are you REALLY REALLY sure you want to delete that row or are you just clumsy?" If the user confirms the deletion the AfterDelConfirm fires.

You can put whatever code you want in that event.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

--- In MS_Access_Professionals@yahoogroups.com, mrsgoudge <no_reply@...> wrote:
>
> Good morning/afternoon,
>
> I have a situation where the user needs to be able to delete a record from a datasheet and if that happens I want to perform a certain vb code. I know that some recommend never deleting, which I will investigate if I ever create another database but for now this is necessary.
>
> I did a google search and found something by Allen Browne but he mentioned needing to account for several records being deleted and I couldn't get my head around how to do that.
>
> I'd REALLY appreciate any help.
>
> Once again--thank you!
> Connie
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar