Florence,
It is possible to use a VBA procedure to open and write to the text file
itself, after the detail records have been exported to it.
Apart from that, the only way I can think of to achieve this is to
export from a Union Query. This would potentially be a lot easier, but
depends on the structure of the text file being exported. For example,
if you are exporting from a multi-field query, and the text file has
comma delimiters between the fields, then the Union Query would need to
export the same number of fields for the last line as well, so you will
end up with the same number of commas after the "END 101" as there are
fields in the main query, if you see what I mean.