Trigger after delete?

masterkale

AuzSolutions
Local time
Tomorrow, 08:09
Joined
Sep 19, 2006
Messages
22
Hi, Basically

I have a transactions form, i have a trigger for after update. For the form which executes some query's and gives you the total.

But the real issue lies in when i do a DELETE, because i cant get it to trigger the sub routine which stores the quereies calculations to run.


So my question is i know there is a before delete etc abut is there an "AFTER DELETE TRIGGER?

Cheers
Tristan F
 
To be certain we're on same wavelengths, Access does not have table triggers common in other RDBMS such as MS SQL, MySQL, PostreSQL, etc.

However, it can be simulated with form's events, which I think you already used AfterUpdate event.

In this case where you want to do something after a record has been deleted, you want the AfterDel Event, IIRC. I don't have Access with me right now, but if you go to form's events tab on the properties windows, and scroll down a bit, you should see three related events pertaining to Deletion- BeforeDel, AfterDel (or similar name, as this is off the top of my head).

HTH.
 
Hi, Banna

Thanks for your response. Unfortunetly it seems after confirm delete hasnt deleted the data yet.

Form update isnt triggering...

I feel sad. lol, 4 + hrs ive spent on this.
Maybe im doing something wrong.

I have a normal transactions form with a datasheet sub form, when i delete on the subform i need to trigger the sub routinue on the transactions table.

Tristan
 
Hmmm...

I'm afraid I don't have Access with me right now, but if you could, look at Access help, type in events (and maybe "After Confirm Delete event") and see if it tells you what next event will follow, as I'm quite certain there is a event that fires after deletion.

Also, how do you delete the record? If you are using Access's default menu, then you could replace that with your own command which would have the extra control you want. Google on "custom menu and toolbars for Access" or something like that.

BTW, any particular reasons why you aren't using BeginTran, CommitTran, Rollback?
 
Hi, Banana

Ihavnt heard of these.... what do they do?

>>BTW, any particular reasons why you aren't using BeginTran, CommitTran, Rollback?


I cant seem to find the after delete trigger.... have looked on the net any help would be appreciated.

Cheers
Tristan F
 
MasterKale, this is what Access help says:

AfterDelConfirm Event
The AfterDelConfirm event occurs after the user confirms the deletions and the records are actually deleted or when the deletions are canceled.

Private Sub Form_AfterDelConfirm(Status As Integer)
Status Indicates whether a record has been deleted. The Status argument can be any of the following intrinsic constants:

Constant Description

acDeleteOK Indicates the deletion was successful.
acDeleteCancel Indicates the deletion was canceled in Visual Basic.
acDeleteUserCancel Indicates the deletion was canceled by the user.

You said it doesn't fire after the deletes are actually deleted when you tried that. Have you checked the Status integer to verify that deletion was successful?


Ihavnt heard of these.... what do they do?

Which 'these' you are asking about? Events or custom menu/toolbar?

If event, I gave a explanation in my first post in this thread. If menu/toolbar, you can google it to get several instructions on how to make one. There's also a handful of threads on how to make one if you search on this board (the Search button is on the blue navigation bar near at the top of the page).

I cant seem to find the after delete trigger.... have looked on the net any help would be appreciated.

Cheers
Tristan F

So are you saying you feel you can use those commands because you haven't found the after delete trigger? Do you realize that they have to be manually coded, which you can use to tell it to execute something after a CommitTrans was issued for a DELETE query?
 
Hey, Nana

Thanks for the response.

I ended up manually coding a Right Click menu that deletes then i can trigger what ever i want after wards... :)

Thanks for your help.

Cheers
 

Users who are viewing this thread

Back
Top Bottom