How to update tables from a subform

new2access123

Registered User.
Local time
Today, 07:08
Joined
Feb 5, 2010
Messages
12
I have created a form containing a subform in datasheet view.
Form.jpg

This is my ERD.
ERD.jpg

Form Select:
SELECT ProjectToParticipant.ProjectID, Participant.ParticipantID, Participant.NameFirst, Participant.NameLast, Participant.NameMiddle
FROM Participant INNER JOIN ProjectToParticipant ON Participant.ParticipantID = ProjectToParticipant.ParticipantID
WHERE (((ProjectToParticipant.ProjectID)=[Forms]![ParticipantInfo]![cboProject]));

Subform select:
SELECT ParticipantTestScores.ParticipantID, ARTest.TestName, ParticipantTestScores.Score, ParticipantTestScores.Right, ParticipantTestScores.Location, ParticipantTestScores.Motion, ParticipantTestScores.BodyPosition
FROM ARTest INNER JOIN ParticipantTestScores ON ARTest.ARTestID = ParticipantTestScores.ARTestID;

The master and child link fields are: ParticipantID

To add a test to the datasheet the user drops the list to select a test.
form drop.jpg

When the test name is selected I get this error.
error.jpg

1. Why am i getting this error? When I click help it says the table is locked. Which table? I have not locked any table and no tables are open in another window.

2. When I close the form and look at the ARTest table a new record has been added.
Bad record.jpg

The objective of the datasheetis to add a record to the ParticipantTestScores table.
- When the user selects a test name the key for that test should automaticly populate ParticipantTestScores.ARTestID
- The key for the participant should populate automaticly populate ParticipantTestScores.ParticipantID

What is the correct way to do this?

Thanks
 
I'm sure I made a comment about this? Can't seem to see my comment, unless this is a double post?
 
I have not seen a comment. What is your suggestion?
 

Users who are viewing this thread

Back
Top Bottom