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.
 
B

Barry Gilbert

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
 
Top