I have an ms access database in which there exit two(2) tables thus tblstudents and tbltrans. The field ID is common to both tables whereas boarder is the criteria and referencing field in tblstudents that I want to use.
Now, I want the system to delete only the selected students in the tbltrans table base on the criteria boarder. Below is the code I used but not working well for me. plse help me
strSQL = "Select * from students where Level BETWEEN " _
& """" & LL & """ and """ & UL & """ and boarder = '';"
DoCmd.RunSQL strSQL
strSQL1 = "DELETE from rstrans (select * from strSQL where " _
& "(((rstrans.tra ns_code) in ('219')));"
DoCmd.RunSQL strSQL1
Now, I want the system to delete only the selected students in the tbltrans table base on the criteria boarder. Below is the code I used but not working well for me. plse help me
strSQL = "Select * from students where Level BETWEEN " _
& """" & LL & """ and """ & UL & """ and boarder = '';"
DoCmd.RunSQL strSQL
strSQL1 = "DELETE from rstrans (select * from strSQL where " _
& "(((rstrans.tra ns_code) in ('219')));"
DoCmd.RunSQL strSQL1
Comment