I am new to writing SQL in MS Access 2013....so I am requesting assistance.
The database has table with Members and another table list member attendance at a list of events. I am working with a form where the user selects the events he/she wishes to delete. I created temporary table with the event and an addition field (Select_Record) to allow the user to check which records to delete.
The objective of the SQL statement is to delete records in the [Attendance Table] based on following criteria in the temporary table [tbl_TempTableDeleteRcds]:
1. [tbl_TempTableDeleteRcds].[Attendance Rcd ID] = [Attendance Table].[ID] i.e. record ID match
2. [tbl_TempTableDeleteRcds].[Select_Record]=True i.e. record marked as "selected" in the tempory table
Here is my SQL statement attached to my button "Delete Selected Records" on the form.
DELETE DISTINCTROW [Attendance Table].*
FROM [Attendance Table] INNER JOIN [tbl_TempTableDeleteRcds] ON [Attendence Table].[ID]=[tbl_TempTableDeleteRcds].[Attendance Rcd ID]
WHERE ((tbl_TempTableDeleteRcds.Select_Record)=True)
When I run the SQL statement I get a VB error "3135" Syntax error in JOIN operation.
Can you point my error?
I also tried a Query with both tables and same two criteria listed above but when I run the query it asks which table to delete the records from.