suppress the flash screen before quit

S

Song

I added following code (copied from
http://www.mvps.org/access/general/gen0041.htm )

before my Docmd.quit

Private Sub cmdExit_Click()
'Compact database before close
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

DoCmd.Quit
End Sub

It seems to work. however, the screen flashed before quit (probably the code
want to reopen the database, then quit). How to suppress the screen flash,
or modify the code so it would not flash? thanks.
 
G

Guest

That code is intended for use when you want the mdb to compact and then
remain open. If you only want it to compact when it closes, look in Tools,
Option, General. Check the Compact On Close checkbox.

Barry
 

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