The form is attempting to close tables as it shuts down.
Don’t programmatically close the data environment tables.
Set AutoCloseTables to false (.F.).