What about:
llError = .F.
lcOnError = On("Error")
ON ERROR llError = .T.
USE Customer EXCLUSIVE IN 0
ON ERROR &lcOnError
IF llError
MessageBox("Could not pack, table in use...")
ELSE
SELECT Customer
PACK
USE
ENDIF
HTH
>Is there a function that determines whether a table is in use.
>
>What I need to acomplish is:
>
>if table_not_in_use()
> select 0
> use customer excl
> pack
> use
>else
> wait window 'Could not pack, table in use...'
>endif