Access 2007 RunTime Ribbon - ms-access
This is a discussion on Access 2007 RunTime Ribbon - ms-access ; Is there a way to disable the office button and the close button (upper-right) from the Access 2007 run-time ribbon? Vincent...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| (upper-right) from the Access 2007 run-time ribbon? Vincent |
|
#2
| |||
| |||
|
In runtime, most of the commands will not even show. However, you can put items like this in the ribbon: idMso="FileCloseDatabase" visible="false"/> visible="false"/> Hope this helps, Andy "Vincent" news:1191354883.689183.294890@22g2000hsm.googlegro ups.com... > Is there a way to disable the office button and the close button > (upper-right) from the Access 2007 run-time ribbon? > > Vincent > |
|
#3
| |||
| |||
|
On Oct 2, 10:24 pm, "ARC" > In runtime, most of the commands will not even show. However, you can put > items like this in the ribbon: > > > idMso="FileCloseDatabase" visible="false"/> > visible="false"/> > > Hope this helps, > > Andy"Vincent" > > news:1191354883.689183.294890@22g2000hsm.googlegro ups.com... > > > > > Is there a way to disable the office button and the close button > > (upper-right) from the Access 2007 run-time ribbon? > > > Vincent- Hide quoted text - > > - Show quoted text - Thanks Andy. This works. However, I still have not found a way to disable the close ("x") button in the upper-right corner of the screen. I have tried making a call to the EnableMenuItem api function, but this isn't working under Access 2007. Has anyone had any success in disabling this button? |
|
#4
| |||
| |||
|
I noticed as well that the previous code to disable the top-right 'x' button no longer works in Access 2007. So, I wonder if there is an "application_on_close" type event where we can run a proc? For me, I would want to code it to close all open forms, and run a backup routine. Let me know if you find something. I would prefer if there was an application on close, instead of disabling the x button (which doesn't look all that great, IMO). Andy |
|
#5
| |||
| |||
|
The only way I've found to do this in 2007 is to have a hidden form that opens when the database starts up, and has the following code (example) on its unload event, and on whatever form or menu you want to allow them to close from also sets a tempvar called 'CloseButtonClicked' to true to allow the app to exit. There is a text box on the hidden form called 'CanDbClose' also. Private Sub Form_Unload(Cancel As Integer) On Error Resume Next If TempVars("CloseButtonClicked").Value Then Forms!nameofhiddenform!CanDbClose = False If Forms!nameofhiddenform!CanDbClose = True Then Cancel = True MsgBox "You cannot close application using this button. You may exit from the main menu only.", , "Application Title" Else MsgBox "Application shutting down.", ,"Application Title" Application.CloseCurrentDatabase End If End Sub |
|
#6
| |||
| |||
|
Sorry to ask a stupid question, but I have loaded the unload event, works great thanks, but having problems getting my one page I want to exit from properly. Not sure exactly how to do this part ... and on whatever form or menu you want to allow them to close from also sets a tempvar called 'CloseButtonClicked' to true to allow the app to exit. There is a text box on the hidden form called 'CanDbClose' also. Any chance you have an example you could show? Or help someone who just appers to not know how to properly set the tempvar? Thanks! Jeff |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 05:14 AM.




Linear Mode