Anything wrong with using this code to Quit?

B

Bob

Private Sub cmdQuit_Click()
If MsgBox("Do You Want To Quit ! ", vbApplicationModal + vbQuestion +
vbYesNo) = vbYes Then
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
DoCmd.Quit
End If
End Sub
--
Thanks Bob







..........Jenny Vance
 
D

David Cox

Yes. It was one of the most awful program design choices that I have seen to
have a program mimic selecting things off a menu. If the menu structure
changes (have you seen Access 2007 Beta?) the code no longer works, unless
the developers do some extreme kludging.

Alas, all I can contribute isto save the guy that will tell you how to do it
right the time to tell you, and any other readers, that. Depending on the
version you are running you may not have a different choice.
 
G

Guest

It is better to do a backup before you do a compact,
because of those rare cases where the compact trashes
or deletes your database.

Why do you need to do a compact every time you quit?
Is there something in your program design that is causing
a problem?

(david)
 

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