>How do I programmatically set the AutoOpenTable and AutoCloseTables properties to .F.?
>I don't see how to get a reference to the DE.
You'd have to set them in the PEM window or to use a subclassed DE. It is created before the form, and when its code runs (like .beforeopentables) it's already too late, it's created and those two properties, which decide its behavior a lot, are set.
IOW, not at runtime.