By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Compact on Closing of form - with a password issue

P: 37
Hi

Have set up a databasde with a quit command button for the user.

When the user closes the database, the databse compacts and repairs itself (using the standard tools option).

Now then.... initially when you open the database you have to enter a password.

When the user clicks the close button the datanse asks for the password again before closing....

How can I get around this...in an easy way...
Jan 17 '07 #1
Share this Question
Share on Google+
8 Replies


P: 37
Also, I tried this way:

Private Sub Quit_Application_Click()
On Error GoTo Err_Quit_Application_Click

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
DoCmd.Quit

Exit_Quit_Application_Click:
Exit Sub

Err_Quit_Application_Click:
MsgBox Err.Description
Resume Exit_Quit_Application_Click

End Sub



--- but I am still asked for the password --- possibly due to the accdodefaultaction......
Jan 17 '07 #2

P: 37
Help....................
Jan 17 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Hi

Have set up a databasde with a quit command button for the user.

When the user closes the database, the databse compacts and repairs itself (using the standard tools option).

Now then.... initially when you open the database you have to enter a password.

When the user clicks the close button the datanse asks for the password again before closing....

How can I get around this...in an easy way...
This shouldn't be happening. How is your login set up?
Jan 17 '07 #4

nico5038
Expert 2.5K+
P: 3,072
Why not use two buttons, one with just the docmd.quit and the other for password checking ?

Nic;o)
Jan 17 '07 #5

P: 37
The login is set up as....(via the exclusive password option)

Click to open database.
Enter password
Use database

Click quit
Compacts
Again asks for password before quitting the application.

The machine that I am testing on is an Access 2000 version....its okay on the xp verison.
Jan 17 '07 #6

P: 37
The users are a little dim...and they may forget to compact before exiting
Jan 17 '07 #7

nico5038
Expert 2.5K+
P: 3,072
Compacting takes time and when they haven't changed records (I guess they didn't where not logged in), the compact isn;t needed....

Nic;o)
Jan 17 '07 #8

NeoPa
Expert Mod 15k+
P: 31,494
Try setting the 'Compact on Close' option rather than executing a separate macro.
The 'Compact & Repair' in your macro is what is causing Access to request the password again I assume.
Jan 17 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.