473,387 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Compact on Closing of form - with a password issue

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
8 2047
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
Help....................
Jan 17 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
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
3,080 Expert 2GB
Why not use two buttons, one with just the docmd.quit and the other for password checking ?

Nic;o)
Jan 17 '07 #5
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
The users are a little dim...and they may forget to compact before exiting
Jan 17 '07 #7
nico5038
3,080 Expert 2GB
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
32,556 Expert Mod 16PB
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

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

Similar topics

0
by: Rick Collard | last post by:
I can consistently crash Access 2002 SP2 using a /runtime switch on an mdb that has the Compact on Close property set after opening and closing a form that uses the References collection. Remove...
1
by: Mark | last post by:
Hi all and thanks in advance, I have a frontend/backend scenario where the backend has a tendency to bloat quit a lot over a period of about 5 days. Once compacted, there is not problem but it...
1
by: robert demo via AccessMonster.com | last post by:
In my startup routine, I have the following code: s = CLng(FileLen(filespec) / 1000000) If s > 5 Then 'FIRST, BACKUP THE FRONT END If BackupFrontEnd = False Then Exit Function End If
10
by: Partha Protim Roy | last post by:
Hello, My problem is: I got a Login form, so once the user enter vaild Username & Password another form opens. How do I close the login form?
43
by: perryche | last post by:
I have searched the site and probably came across dozens of posts... I am somewhat confused about the replies... here is my situation, see if someone can point me to where to go: I have splitted...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
29
by: Neil | last post by:
I would like to compact on close only if the database size goes over a certain amount, rather than each time. Thus, I'd like to check the file size and then perform the compact through code as the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.