I have a SQL 2008 backend running with an Access frontend. I have them connect via linked tables and linked views. The form in question holds a student's previous classes from their transcript. To add to this specific form I have an instead of insert trigger written and the same for the update.
However, I need to have a way to delete a specific record from this form. My problem is that the student ID can't be used in the WHERE clause due to only needing to delete one record based on it not all the student's classes. Also, they can have duplicate course names because of having retaken them. I would just delete it based on the grade but I have students that have failed the same course twice in the same year (it is an online school so students work at their own pace. The class can literally be taken in the same month and both records look exactly the same).
Now is there any way to get the record ID field from somewhere? Like would something along the lines of this work?
Code:
DELETE FROM tbl_transcript WHERE tbl_transcript.ID IN (SELECT ID FROM deleted)
AND tbl_transcript.EMIS_ID IN (SELECT EMIS_ID FROM deleted)
I wasn't sure if the deleted ID would be the same as the transcript ID. I would normally do this on the replicated server and just find out but currently it is down due to one of my coworkers changing fields in a table. My supervisor wants this taken care of before the replication for some reason.
Thanks