I have had similar problems in the past when using tables but preferring to control the underlying data with
HF commands. I have not read your code but consider these two options. Try:
1. TableSelectToFile() which links the selected table row to the underlying record.
2. TableRecNum() immediately followed by HDelete(File, RecNum)
Regards
issah