I have following code to insert in access table
insertstring = "INSERT INTO Attendance (School_ID, Grade, Years, School_Open_Days) VALUES ('" & School.Value & "','" & Grade.Value & "','" & Year.Value & "'-1,'" & School_Open.Value & "');"
And with different variables for the same command, so i could insert data in two table at once from a single form, where in one table the Year would be actual and in this Attendance table , it will be Year.Value & "'-1 ( It will be less than a year that is entered in the textbox for year in the table.)
I can insert in but while i like to delete suppose if the year is 2013 i can delete from table
DoCmd.RunSQL "DELETE FROM School WHERE School_ID = '' & School.value & '' AND Year = '' & Year.Value & ''"
But i cant from the table where the year is 2012 which is previously made 2012 by the code ,'" & Year.Value & "'-1, on inserting.
DoCmd.RunSQL "DELETE FROM Attendance WHERE School_ID = '' & School.value & '' AND Year = '' & Year.Value & ' ' -1 "