well, if you use a recordset for the file name, there are 2 things to bear in mind:
1) the code for the recordset must come before the file delete behavior.
2) make sure that any filter that is needed to filter the recordset is passed with the form
it's simpler to just use the hidden element.