Hello,
This is my code:
UPDATE tblSpeakers INNER JOIN [tblRSC-Speakers] ON tblSpeakers.SpeakerID = [tblRSC-Speakers].SpeakerID SET [tblRSC-Speakers].SpeakerID = 404
WHERE ((([tblRSC-Speakers].RSCID)=[forms]![frmRSC].[RSCID]));
What I want it to do is take tblRSC-Speakers and change the SpeakerID to 404 for every record where RSCID equals the currently active RSCID as shown on my form.
For some reason, this only works partially - the first record is changed, but not the other [I have 2 records in my test setup]. First I was asked if I wanted to update 2 records, I clicked OK and was then presented with an error message that said one record failed to update due to key violations.
I don't see where there could be any key violations, but obviously, something is wrong, so I would be grateful if somebody could help me fix this.
Also, how can this be done in code so that I wouldn't need a separate update query?
Right now I'm just calling the query:
Dim stDocName As String
stDocName = "uqryCanceled"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Thank you.
This is my code:
UPDATE tblSpeakers INNER JOIN [tblRSC-Speakers] ON tblSpeakers.SpeakerID = [tblRSC-Speakers].SpeakerID SET [tblRSC-Speakers].SpeakerID = 404
WHERE ((([tblRSC-Speakers].RSCID)=[forms]![frmRSC].[RSCID]));
What I want it to do is take tblRSC-Speakers and change the SpeakerID to 404 for every record where RSCID equals the currently active RSCID as shown on my form.
For some reason, this only works partially - the first record is changed, but not the other [I have 2 records in my test setup]. First I was asked if I wanted to update 2 records, I clicked OK and was then presented with an error message that said one record failed to update due to key violations.
I don't see where there could be any key violations, but obviously, something is wrong, so I would be grateful if somebody could help me fix this.
Also, how can this be done in code so that I wouldn't need a separate update query?
Right now I'm just calling the query:
Dim stDocName As String
stDocName = "uqryCanceled"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Thank you.