CompactRepair and databound subforms

G

Glen Appleton

Hi!

I have a project that utilizes a local external .mdb file for caching data
from our SQL server to perform order submission processing and reports. In
the main project file, I have several subforms on the main form that are
bound to tables within the external .mdb file. I'm trying to use the
Application.CompactRepair method to compact the external db after closing
the main form and clearing the data from the tables.

The problem I'm running into is that the main project file is not closing
the connection to the external db even after the main form is closed, thus
producing an error when I try to compact. I suspect it has something to do
with the fact that the subforms are actually unloaded from memory after the
main form has closed. I'm closing the main form, clearing the data using
SQL, and calling the CompactRepair from a separate module (not from within
the form's code).

Is there a way to force the main project file to close all external
connections using VBA?

- Glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top