>>Try selecting the alias of the table you just opened just before the ZAP command.
>>
>You're responding to the wrong person. :)
Not really. Your code does not reselect the initial alias ...
>>You could also...
>>IF NOT USED(lcOutputName)
>> SELECT 0
>> USE (m.lcOutputPath) EXCLUSIVE
>> SET SAFETY OFF
>> ZAP
>> SET SAFETY ON
>>ENDIF
Gregory