Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Access trigger?

I have two tables named [Insert_Record] and [Delete_Record] in MS Access. Both tables have the same fields but one table has records whereas another table has no record.

Question: I want, whenever I delete any record from the table [Insert_Record] that entire record should automatically insert into another table, i.e: [Delete Record].

How can I accomplish this?

like image 744
Farid Avatar asked Apr 11 '11 15:04

Farid


People also ask

Does Microsoft Access have triggers?

Working with Triggers - MS Access. SQL Server triggers are another very clever feature that allows for some very powerful programing. Access has data macros, which are similar to triggers, but they do not support a transactional model, which is an inbuilt feature of SQL Server triggers.

How do you use triggers in Access?

You can open a trigger to view or edit the text of an existing trigger that is stored in your database. Triggers are scripted in Transact-SQL for Microsoft SQL Server databases. under Objects. Right-click the name of the table whose trigger you want to open and choose Triggers from the shortcut menu.

What is the use of trigger?

Triggers allow you to perform the following tasks: Enforce business rules. Validate input data. Generate a unique value for a newly inserted row on a different file (surrogate function)


1 Answers

Access 2010 introduced event-driven Data Macros that are similar to triggers. The process described in the question can easily be done with an After Delete data macro on the [Insert_Record] table:

AfterDelete.png

like image 99
Gord Thompson Avatar answered Oct 09 '22 20:10

Gord Thompson