Recordset Loops
I recently answered a question on my Facebook site… Link:- Full Text of my Answer:- basically it would be best to use a record set loop to solve the OP’s problem.
I agree with Sherry, you need to use a Recordset Loop… I did a set of video instructions on how to create a Checklist in an MS Access database.
One part of the video covers the record set loop. If you have a look at this video:- 1 – Adding a Checklist to MS Access at this time index:- https://youtu.be/r1y_Zl3uLkM?t=1m12s
The three videos below are actually three separate time indexes of the same video, time indexes to each place in the video relevant to the question.
The Two Functions
The Two Functions
Video 1 (Time Index 72 to 95)
This Video clip gives you an overview. The video discusses the function on the left, which is something similar to What You Want. Move on through the video to this time index:- https://youtu.be/r1y_Zl3uLkM?t=1m49s
Video 1 (Time Index 72 to 95)
… …
The Function "fCopyListToData"
The Function "fCopyListToData"
Video 2 (Time Index 109 to 150)
In this video clip, I discuss the operation of that function which is generally termed a “Recordset Loop” If you go to the video at this time index https://youtu.be/r1y_Zl3uLkM?t=3m20s
Video 2 (Time Index 109 to 150)
… …
Extracting the Row Information
Extracting the Row Information
Video 3 (Time Index 200 to 250)
That’s the bit you need to change, listSets and listID refer to fields in the record set passed into the record set loop. You need to provide your own SQL statement based on your own tables and then change listSets and listID to the particular fields in the tables from your project you have passed in then check the contents of those variables which represent the fields past in. With regard to deleting a row, off the cuff so to speak without attempting to do it myself, I think I would add an extra field to your table, a boolean field, and write the code to flag the field(s) you want to delete.
Video 3 (Time Index 200 to 250)
Complete set of videos along with a download of the sample database are available on my website here:- Add a Check List to your MS Access Database
… …