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.

Signature
Steve Schapel, Microsoft Access MVP
> Dear Steve,
>
[quoted text clipped - 9 lines]
> So I need to have another query getting the number of records first? Any
> other alternatives are appreciated.
Florence - 26 Sep 2006 10:03 GMT
Steve,
Yes, I got what you mean. And I don't want to have the same number of comma
delimiters for the last line.
I think I have to rewrite it by VBA.
Thanks anyway.
> Florence,
>
[quoted text clipped - 23 lines]
> > So I need to have another query getting the number of records first? Any
> > other alternatives are appreciated.