Hiding Ribbon and Close X buttons (1 Viewer)

stu_c

Registered User.
Local time
Today, 07:59
Joined
Sep 20, 2007
Messages
489
Hi all
I know this has be talked about before but I cannot seem to get this to work, I have access 2007 and trying to hide the ribbon bar on my database but doesnt seem to work,

I followed this proceedure on here but still no luck :(

http://msdn.microsoft.com/en-us/library/bb258192.aspx

also is there a way to disabe the close button in the top corner of access so they can only close by a macro button?
 

JohnLee

Registered User.
Local time
Yesterday, 23:59
Joined
Mar 8, 2007
Messages
692
Hi,

I can't answer your question about the Ribbon, but with regards to the close button within your form properties you can disable/turn off the Close "X" button.

In the Form "All Properties" locate the property Control Box set this to "No" [without quotes], locate the property Min Max Buttons set this to "None" [without quotes], locate the property Close Button set this to "No" [without quotes]

Ensure you have your Close button created first, otherwise you'll be stuck with your form in Open mode.

Regards

John
 

aziz rasul

Active member
Local time
Today, 07:59
Joined
Jun 26, 2000
Messages
1,935
The close button disappears if the form property Control Box is set to No.

As for hiding the ribbon I use the following code (Open event) on my Splash screen. Save a copy of your db before you try. Just in case.

Code:
Call HideUnHideToolbar(True)

Code:
Public Sub HideUnHideToolbar(blnHide As Boolean)

    If blnHide = True Then
        DoCmd.ShowToolbar "Ribbon", acToolbarNo
    Else
        DoCmd.ShowToolbar "Ribbon", acToolbarYes
    End If
    
End Sub

You can place the code

Code:
Call HideUnHideToolbar(False)
on a logo of a form to see the ribbon again. But don't tell anyone.
 

JohnLee

Registered User.
Local time
Yesterday, 23:59
Joined
Mar 8, 2007
Messages
692
Hi,

Yes, I thought that was what was wanted, to not allow the user to see it, access it and only exit the form via the button created.

Perhaps I mis-understood.

Regards

John
 

stu_c

Registered User.
Local time
Today, 07:59
Joined
Sep 20, 2007
Messages
489
The close button disappears if the form property Control Box is set to No.

As for hiding the ribbon I use the following code (Open event) on my Splash screen. Save a copy of your db before you try. Just in case.

Code:
Call HideUnHideToolbar(True)

Code:
Public Sub HideUnHideToolbar(blnHide As Boolean)
 
    If blnHide = True Then
        DoCmd.ShowToolbar "Ribbon", acToolbarNo
    Else
        DoCmd.ShowToolbar "Ribbon", acToolbarYes
    End If
 
End Sub

You can place the code

Code:
Call HideUnHideToolbar(False)
on a logo of a form to see the ribbon again. But don't tell anyone.


Hi
thanks for the code, I tried doing this but bringing up an error :(

Private Sub Form_Open(Cancel As Integer)

Call HideUnHideToolbar(True)
Public Sub HideUnHideToolbar(blnHide As Boolean)
If blnHide = True Then
DoCmd.ShowToolbar "Ribbon", acToolbarNo

Else

DoCmd.ShowToolbar "Ribbon", acToolbarYes

End If

End Sub

Private Sub TITLE_Click()
Call HideUnHideToolbar(False)

End Sub

also it was the X button for Access application not for particular forms :)

sorry to be a pain :(
 
Last edited:

aziz rasul

Active member
Local time
Today, 07:59
Joined
Jun 26, 2000
Messages
1,935
What error did you get and what was the error. I am using this code in my current db and it works fine.

Part of my References include

Microsoft Access 14 Objects Library
Microsoft ActiveX Data Objects 6.0 Library
Microsoft Scripting Runtime
Microsoft Shell Controls And Automation

See if that helps.
 

stu_c

Registered User.
Local time
Today, 07:59
Joined
Sep 20, 2007
Messages
489
sorry my bad!

I was missing an End sub on one line!

the ribbons now gone but still shows the very top bar (saying file name with the minimise button, X button etc)

is it possible to hide this too?
 

aziz rasul

Active member
Local time
Today, 07:59
Joined
Jun 26, 2000
Messages
1,935
In Options -> Current Database untick

Allow Full Menus
Allow Default Shortcut Menus

See if that helps. Agian make a copy of your db just in case.
 

KenHigg

Registered User
Local time
Today, 02:59
Joined
Jun 9, 2004
Messages
13,327
Q - If I open a 2003 mdb in 2007 the ribbon shows up but I can't seem to get code to turn it off. Is this normal? Is there a work around other than to convert it to a 2007 db?
 

aziz rasul

Active member
Local time
Today, 07:59
Joined
Jun 26, 2000
Messages
1,935
Ken have you tried the code I gave on an opening form?
 

stu_c

Registered User.
Local time
Today, 07:59
Joined
Sep 20, 2007
Messages
489
In Options -> Current Database untick

Allow Full Menus
Allow Default Shortcut Menus

See if that helps. Agian make a copy of your db just in case.

just tried this but still leaves the Close button etc in the far top right corner :(
 

Users who are viewing this thread

Top Bottom