Thanks for your input, I really appreciate all your help. I was able to create trigger as suggested and it saved to the table but its not firing when of the radio buttons is ticked and "Save Changes" is applied.
Code: Select all
DELIMITER //
CREATE TRIGGER update_activity AFTER INSERT ON MembershipRoster
FOR EACH ROW
BEGIN
CASE NEW.Activity
WHEN 'Inactive' THEN INSERT INTO `InactiveMembers` (ID, Activity, MType, ClanID, Region, State, ReNewMonth, LastName, FirstName, SpouseName, Prefix, StreetAddress, City, States, Zip, Country, SNBD, TelePhone, EmailAddress, ReNew, Joined, PD2016, PD2017, PD2018, PD2019, PD2020, PD2021, PD2022, PD2023, PD2024, PD2025, PD2026, PD2027, InvoiceSent, Cancellation, DateTerm, Alert) VALUES (NEW.ID, NEW.Activity, NEW.MType, NEW.ClanID, NEW.Region, NEW.State, NEW.ReNewMonth, NEW.LastName, NEW.FirstName, NEW.SpouseName, NEW.Prefix, NEW.StreetAddress, NEW.City, NEW.States, NEW.Zip, NEW.Country, NEW.SNBD, NEW.TelePhone, NEW.EmailAddress, NEW.ReNew, NEW.Joined, NEW.PD2016, NEW.PD2017, NEW.PD2018, NEW.PD2019, NEW.PD2020, NEW.PD2021, NEW.PD2022, NEW.PD2023, NEW.PD2024, NEW.PD2025, NEW.PD2026, NEW.PD2027, NEW.InvoiceSent, NEW.Cancellation, NEW.DateTerm, NEW.Alert);
WHEN 'Resigned' THEN INSERT INTO `ResignedMembers` (ID, Activity, MType, ClanID, Region, State, ReNewMonth, LastName, FirstName, SpouseName, Prefix, StreetAddress, City, States, Zip, Country, SNBD, TelePhone, EmailAddress, ReNew, Joined, PD2016, PD2017, PD2018, PD2019, PD2020, PD2021, PD2022, PD2023, PD2024, PD2025, PD2026, PD2027, InvoiceSent, Cancellation, DateTerm, Alert) VALUES (NEW.ID, NEW.Activity, NEW.MType, NEW.ClanID, NEW.Region, NEW.State, NEW.ReNewMonth, NEW.LastName, NEW.FirstName, NEW.SpouseName, NEW.Prefix, NEW.StreetAddress, NEW.City, NEW.States, NEW.Zip, NEW.Country, NEW.SNBD, NEW.TelePhone, NEW.EmailAddress, NEW.ReNew, NEW.Joined, NEW.PD2016, NEW.PD2017, NEW.PD2018, NEW.PD2019, NEW.PD2020, NEW.PD2021, NEW.PD2022, NEW.PD2023, NEW.PD2024, NEW.PD2025, NEW.PD2026, NEW.PD2027, NEW.InvoiceSent, NEW.Cancellation, NEW.DateTerm, NEW.Alert);
WHEN 'Deceased' THEN INSERT INTO `KnownDeceased` (ID, Activity, MType, ClanID, Region, State, ReNewMonth, LastName, FirstName, SpouseName, Prefix, StreetAddress, City, States, Zip, Country, SNBD, TelePhone, EmailAddress, ReNew, Joined, PD2016, PD2017, PD2018, PD2019, PD2020, PD2021, PD2022, PD2023, PD2024, PD2025, PD2026, PD2027, InvoiceSent, Cancellation, DateTerm, Alert) VALUES (NEW.ID, NEW.Activity, NEW.MType, NEW.ClanID, NEW.Region, NEW.State, NEW.ReNewMonth, NEW.LastName, NEW.FirstName, NEW.SpouseName, NEW.Prefix, NEW.StreetAddress, NEW.City, NEW.States, NEW.Zip, NEW.Country, NEW.SNBD, NEW.TelePhone, NEW.EmailAddress, NEW.ReNew, NEW.Joined, NEW.PD2016, NEW.PD2017, NEW.PD2018, NEW.PD2019, NEW.PD2020, NEW.PD2021, NEW.PD2022, NEW.PD2023, NEW.PD2024, NEW.PD2025, NEW.PD2026, NEW.PD2027, NEW.InvoiceSent, NEW.Cancellation, NEW.DateTerm, NEW.Alert);
END CASE;
END; //
DELIMITER ;
and not sure if back ticks are required in VAULES (NEW.
I also thought ID might be the problem. In MembershipRoster, ID is, primary key and auto increment and the other tables InactiveMembers, ResignedMembers and KnownDeceased, "ID" is primary key and read only, but not auto increment.
Any insight to what I'm doing wrong.
Thanks again.