martinhough
Registered User.
- Local time
- Today, 03:31
- Joined
- Feb 2, 2011
- Messages
- 16
If I had any, I'd have pulled it out by now!
I need some expert help please.
I have a main form (unbound) and a main form (bound) and then a subform (or a main form;subform;subform).
The main form has the following SQL;-
SELECT Detail.*, Hazards.*, HowHarmed.*, Section.*
FROM PSR RIGHT JOIN (Hazards INNER JOIN ([Section] INNER JOIN (HowHarmed INNER JOIN Detail ON HowHarmed.ID = Detail.HowHarmedID) ON Section.ID = Detail.[Subject Area]) ON Hazards.ID = Section.detailID) ON PSR.ID = Detail.PSR;
This form appears to work fine. Essentially, there is a control on the unbound form whereby the user selects the section and it populates the respective form with the various 'detail' of the various records.
My tables are as follows;-
Risk Assessments
Detail
Section
HowHarmed
Hazards
PSR
PLR
Staff
In the subform there are records from Riskassessments, which is the table in the source property of this subform (and not on the main form) with a link to PSR of which is on the mainform. Again, these appear to work if the record is entered via the tables - all the tables appear to be linked correctly from their respective dropdowns (+ sign) but when I go to add a new record in this subform, I get the error "The link masterfields property has produced this error: 'The object doesn't contain the automation object ID'." When I try to update from this entry the following message is presented;-
"The ms Office access database engine cannot find a record in the table 'Detail' with key matching field(s) 'DetailID'.
The SQL for this subform is as follows;-
SELECT Detail.*, PLR.*, RiskAssessments.*
FROM (Detail INNER JOIN RiskAssessments ON Detail.ID = RiskAssessments.DetailID) LEFT JOIN PLR ON RiskAssessments.PLR = PLR.ID;
The most frustrating thing is that it did work previously but I've been looking at it for too long and for the life of me can't unravel what I've done to 'unfix' it!
Help? :banghead:
I need some expert help please.
I have a main form (unbound) and a main form (bound) and then a subform (or a main form;subform;subform).
The main form has the following SQL;-
SELECT Detail.*, Hazards.*, HowHarmed.*, Section.*
FROM PSR RIGHT JOIN (Hazards INNER JOIN ([Section] INNER JOIN (HowHarmed INNER JOIN Detail ON HowHarmed.ID = Detail.HowHarmedID) ON Section.ID = Detail.[Subject Area]) ON Hazards.ID = Section.detailID) ON PSR.ID = Detail.PSR;
This form appears to work fine. Essentially, there is a control on the unbound form whereby the user selects the section and it populates the respective form with the various 'detail' of the various records.
My tables are as follows;-
Risk Assessments
Detail
Section
HowHarmed
Hazards
PSR
PLR
Staff
In the subform there are records from Riskassessments, which is the table in the source property of this subform (and not on the main form) with a link to PSR of which is on the mainform. Again, these appear to work if the record is entered via the tables - all the tables appear to be linked correctly from their respective dropdowns (+ sign) but when I go to add a new record in this subform, I get the error "The link masterfields property has produced this error: 'The object doesn't contain the automation object ID'." When I try to update from this entry the following message is presented;-
"The ms Office access database engine cannot find a record in the table 'Detail' with key matching field(s) 'DetailID'.
The SQL for this subform is as follows;-
SELECT Detail.*, PLR.*, RiskAssessments.*
FROM (Detail INNER JOIN RiskAssessments ON Detail.ID = RiskAssessments.DetailID) LEFT JOIN PLR ON RiskAssessments.PLR = PLR.ID;
The most frustrating thing is that it did work previously but I've been looking at it for too long and for the life of me can't unravel what I've done to 'unfix' it!
Help? :banghead: