@rvk Well, I looked at your project, totally understood it and amended mine in the places where we differed. Now, when I perform an edit, I get the "Operation cannot be performed on an inactive dataset" error but, when the program re-opens, the edits have been posted!! I have taken the liberty of attaching a zipped copy of the project (hope I've done it right)

. Obviously, I omitted your database creation code as the tables were already constructed and in operation. The tables were created thus:
Master -
CREATE TABLE `Recartst` (
`Reference` VARCHAR(5) NOT NULL,
`Title` VARCHAR(50) NOT NULL,
`Artist` VARCHAR(80) NOT NULL,
`Christmas` VARCHAR(1),
`Status` INTEGER,
PRIMARY KEY(Reference)
);
Detail -
CREATE TABLE `Rectrack` (
`Reference` VARCHAR(5) NOT NULL,
`TrackOrder` INTEGER NOT NULL,
`Track` VARCHAR(100) NOT NULL,
`Artist` VARCHAR(80) NOT NULL,
FOREIGN KEY(`Reference`) REFERENCES `Recartst`(`Reference`) ON DELETE CASCADE
);
You will note that the project has several units but at the moment only the data module has any coding. This is a working program which I did in Delphi 5 ten or so years ago. To familiarise myself with Lazarus/FPC, I decided to construct it from scratch in Lazarus rather than attempt a conversion. I knew that the database side of things would be the most problematic as, in Delphi, of course, the trusty old BDE took care of most of the donkey work!! I'm confident that the rest of the coding will not be as difficult.
I would be grateful if you would cast your expert eye over this when you have some time and see if you can spot where I'm going wrong.
Many thanks.