>S-O-R-T-E-D!!
>
>Sort of -
>
>in that I've fixed the problem but I still don't understand why it was a problem or why it exhibited the particular symptoms that it did.
>
>TARGFILE=(PROGPATH)+'QUERIES\ACCFIL'+PADL(NUMUSED,2,'0')
>
>That, comrades, is the line responsible for all the fuss.
>
>whereas...
>
>TARGFILE=(PROGPATH)+'QUERIES\ACCFILT'
>
>works perfectly...
>
>TARGFILE is used later to create the SQL selection statement and if the PADL expression is included it goes berserk as advertised -
>despite creating the file with the desired filename and allowing full access to the resultant query...
>
>File under 'VFP Poltergeist'?
>or has anyone got a rational explanation?
>
>In the meantime - many thanks to those of you who tried to help and especially to you Eric, for not letting me give up!
>
>Harry
Since the PADL() chokes it up on you, does this work OK?
TRANSFORM(numused,"@L ##")