IF USED('mytable') USE IN mytable ENDIFOr if you don't know what tables may have been opened then either always open the table with a specific alias (e.g. table1...table20 and then loop through the names to see if they are used when you close the form) or store the open table's name in a form property in which case you will have to close it before the form's release is finished or the property will no longer exist when you try to close the form. Does the form use a private data environment?