Or, it might be easier, to just write your text file on Form_FormClosing, then you won't need to keep updating it when your user deletes rows or makes any other changes to the structure of the table