Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing the database by clicking on the Exit button Only 1

Status
Not open for further replies.

tina20

Programmer
Sep 1, 2000
16
US
Hi All,
I create an EXIT BUTTON that has the code for compact the database behind it; and it is placed on the switchboard. I want to the users have to click on this EXIT BUTTON to closing the database.
Are there any ways to force the users using my EXIT BUTTON by hiding the X button (close) from the top right side of the database?


Thanks for your help
 
tina20
If you open the switchboard in Design view and go to its Properties, and then scroll down to the "Close Button" you can disable it.

Tom
 
How are ya tina20 . . . . .
tina20 said:
[blue]I create an EXIT BUTTON that has the code for compact the database behind it; . . .[/blue]
[purple]Really![/purple] . . . . could you post this code?

To my knowledge you [purple]can't compact a database while code is running![/purple]

Calvin.gif
See Ya! . . . . . .
 
tina20 -

See Thread705-681065 for a discussion of 2 different techniques (I prefer Bill Power's approach).

Ken S.
 
THWatson,
Thank you for your help. I try your suggest and it works well on the form only. It hides the “Close button” (X) from the Switchboard form only and the “Close button” (X) for the whole database is still there.

TheAceMan1,
You’re right. I just compact the back-end database

Regards,
Tina20
 
TheAceMan1 -

Yes, you *can* compact the database through code - you can do SendKeys to access the menu commands, but that's kinda clunky 'cuz you can see the menus popping when it runs. A better way is this code behind a command button:
Code:
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
Works in Access 2K and higher. Originally posted by WildHare in thread705-642227.

HTH...

Ken S.
 
TheAceMan1,
It works perfectly. Thank you.

Since the users still can click on the EXIT from the FILE menu, are there any ways that we can hide the "EXIT" under the FILE Menu?

Thanks.
 
tina20,

If you use Bill Power's method from the thread I posted above, the ONLY way out of the app is your command button (or a CTRL-ALT-DEL kill).

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top