check other DB, Compact other DB, Open other DB

Joined
Jun 27, 2005
Messages
3
Reaction score
0
G'day,
I have a *******isation of a compact database that will when opened and a button is clicked, it will automatically compact a seperate DB then open that DB and close the compactor DB. My problem is that I want it to check (query) a table before any compacting happens. In my DB that will eventually open, I have two tables (one for in and one for out corrospondence) and an append query.
When the form first opens it runs an append query that selects records that meet a certain date requirement, then a delete query will delete those records from the main table.
I have set it up this way so that at the start of each year, it will automatically move and delete the records.
The compactor DB will by compacting reset the autonumber.
The code I have for the compactor came from the AutoCompact97 db and I have added this to open the compacted db
Dim accappNwind As Access.Application
Set accappNwind = CreateObject("Access.Application.8")
accappNwind.OpenCurrentDatabase "C:\MyDatabase.Mdb"
accappNwind.Visible = True
accappNwind.DoCmd.OpenForm "Switchboard"
Set accappNwind = Nothing

Any ideas on how could I get this compactor to check the records (from the other database) against the current date, then run the queries, then compact, then open????
 

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