Mass updating of a Database from a listbox

I have a listbox that has multiple rows of data in it, all of which correspond to a backend database. I need to enable my user to do a “mass update” to every row in the listbox against the database. I have all the necessary information in the listbox columns, but I’m not sure how to pass all the data to my database and then how to best iterate through each one.

Help on best approach here?

There are probably other ways, but I would do it like this:

  1. Build a prepared statement to update a row in the database.
  2. Begin a transaction.
  3. Iterate through the listbox rows binding the data to the ps & execute the PS.
  4. Commit the changes.

With careful structuring of the ps to match the listbox columns you can use two For/Next loops, the first for the listbox rows, the second to bind each column to the prepared statement.

HTH

That makes sense, Wayne. I think I have been working on this project too long today. i should have been able to figure that out much more easily :stuck_out_tongue: