Sign up ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I got a trigger to update a table in SQL.

My actual need is in MS Access but I could not make it. So please help me to write the same trigger in MS Access.

Query is as follows:

Create  trigger insert_action 
on [quantity]
instead of  insert
    declare @no int,@pro_id int,@pro_name varchar(10),@quantity int
    set @pro_id=(select pro_id from inserted);
    set @pro_name=(select pro_name from inserted);
    set @quantity=(select quantity from inserted);
    update quantity set quantity = quantity+@quantity where  pro_id=@pro_id;
    if not exists(select pro_id from quantity where pro_id=@pro_id)
        insert into quantity values(@pro_id,@pro_name,@quantity) 
share|improve this question
I am pretty sure that MS Access does not have any triggers like SQL Server, etc. You have to implement data macros using events. See this post --… –  bluefeet Feb 6 '13 at 11:18
Here is a rough example from Stackoverflow… –  Remou Feb 6 '13 at 11:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.