UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Hidding Ribbon?, Access 2007    
 
   
Patty2
post Jun 28 2017, 11:28 AM
Post#1



Posts: 402
Joined: 10-August 08



Hello, I found a code to hide the database ribbon
DoCmd.ShowToolbar "Ribbon", acToolBarNo

Now if the Ribbon is not viewable, how then do I go back to the codes to "yes" see the ribbon if I cannot go to "Create" > "Macros & Code" > "Visual Basic" ?
Must be another way to get to the codes without using the Ribbon?
Thank you
Go to the top of the page
 
theDBguy
post Jun 28 2017, 11:42 AM
Post#2


Access Wiki and Forums Moderator
Posts: 71,013
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Where are you executing this code? Maybe you can create an Autokeys macro to execute the reverse code.

Just a thought...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
Patty2
post Jun 28 2017, 11:48 AM
Post#3



Posts: 402
Joined: 10-August 08



Form_Switchboard
Go to the top of the page
 
Patty2
post Jun 28 2017, 11:51 AM
Post#4



Posts: 402
Joined: 10-August 08



and what if......it was already created and exicuted and now I need to go back and undo it?
Go to the top of the page
 
theDBguy
post Jun 28 2017, 12:00 PM
Post#5


Access Wiki and Forums Moderator
Posts: 71,013
Joined: 19-June 07
From: SunnySandyEggo


If you create an Autokeys macro, then you just hit the key combo you assigned to get the Ribbon back.

Also, you might consider "minimizing" the Ribbon rather than "hiding" it, so you can easily get it back.

Just my 2 cents...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
AlbertKallal
post Jun 28 2017, 12:25 PM
Post#6


UtterAccess VIP
Posts: 2,540
Joined: 12-April 07
From: Edmonton, Alberta Canada


You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the file->options.

Using those options allows you to complete hide the ms-access interface (tool bars, database window etc).

And then using that code to hide the ribbon will complete this process.

Also, using these options means you do not have to bother setting up
security etc. to keep people out of design mode etc.

Of course, during development, you will hold down the shift key so your
startup settings don't run. You then develop for awhile, and then to test in
"user" mode, you exit, and then re-enter the application without the shift
key bypassed.

You will likely do this dance all day long as you run/test as
user mode, and then flip back in to developer mode (shift key used..so you
don't get the main custom menu). So, you cant develop, or really modify
things when you run your application with the startup settings...so you must
shift-by-pass them when you want to work.

And, in fact, I use alt-f4 to exit the application...the mdb/accDB file should still be highlighted in the windows explorer. So then you hit enter key (and, hold down shift key if you need be). This key stroke sequence and exiting and re-entering the application will occur CONSTANTLY all day long when you are developing.

When you finally have things just right? You will then compile your application into a accDE you plan to distribute to each workstation.

I mean even things like autokeys can run on startup and re-map f1 or f12 for a barcode scanner etc. So you really cannot in ANY practical way work on a application with the "ton" of startup options you set for "end users". So you have to shift by-pass into your application for development needs. There really no way to develop or work on a application with that "ton" of startup options etc. active. So shift key by-pass will "ignore" all of the startup setting you kindly set in Access - and shift by-pass will also not run your startup code that rather likely runs additional code to hide the Access UI which is required for development.

Between your startup code, and the file->option settings there is about 100 settings that you not want when attempting to develop your application as opposed to running in "user" mode. So you shift in an out of your application all day long to "test" as "user" and "work" as developer.

Regards
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
kallal@msn.com
Go to the top of the page
 
Patty2
post Jun 28 2017, 01:00 PM
Post#7



Posts: 402
Joined: 10-August 08



ok, so if I start up holding the SHIFT key, the toolbar will be available and Alt + F11 to open codes, then I need to open the Switchboard Form (where the DoCmd.ShowToolbar code is located) to be able to see this code and change it back to "Yes"

Does this seem doable? or is there an easier way? Have not created a module
Go to the top of the page
 
BattleCat
post Jun 28 2017, 01:24 PM
Post#8



Posts: 270
Joined: 15-May 14
From: USA


Or you can minimize the application leaving just the form in a popup. I do this with the on load event
Attached File(s)
Attached File  minimize.jpg ( 10.98K )Number of downloads: 3
 

--------------------
BattleCat
Go to the top of the page
 
AlbertKallal
post Jun 28 2017, 10:43 PM
Post#9


UtterAccess VIP
Posts: 2,540
Joined: 12-April 07
From: Edmonton, Alberta Canada


I am guessing that the startup code or one line of VBA to hide the ribbon was placed in your main startup forms code module (the on-load event).

I suppose you could modify the code to "no". However, your switch board likely just launches other forms and reports. So in “general” VERY little development and changes will occur to your switchboard.

So you likely can just launch the application (shift by-pass). You are then free to open in design mode the particular part of your application that you need to work on. Test that part. And then to see the “whole” application run as it will in user mode, then you can exit + re-enter without shift by-pass.

About the only case in which I would bother to change that hide ribbon code would be if you need to work on and modify the switchboard code. So sure, in that case you could shift in and then simply modify (or even comment out) the line of code to hide the ribbon.

However since as noted you not likely to be doing a lot of development work on that switchboard form, so once you shift in, you are free to open, view, design the additional parts and forms as you require. At that point you could launch the switchboard to “test” things – but it would hide your ribbon. So you have to exit + re-enter after testing as such.

In fact to save on the exit + re-enter process, I place the compact + repair button in the QAT. So it only one mouse click to re-launch the application (and I either hold down, or not the shift key). So this trick allows me to flip between developer and user mode with one simple mouse click.


Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
kallal@msn.com
Go to the top of the page
 
BuzyG
post Jun 29 2017, 08:11 AM
Post#10



Posts: 331
Joined: 20-September 12
From: Cornwall UK


When I'm testing a new version I use the following code on the main form. This hides the Developement environment every time I launch the database.

CODE
Private Sub Form_Open(Cancel As Integer)
  Dim q As Integer
  'Hide the Ribbon
  DoCmd.ShowToolbar "Ribbon", acToolbarNo
  
  'Hide the Status Bar
  Application.SetOption "Show Status Bar", False
    
  'Disable Right Click on Mouse
  For q = 1 To CommandBars.Count
    CommandBars(q).Enabled = False
  Next q
'Hide the Navigation Bar
DoCmd.RunCommand acCmdWindowHide

End Sub

I then have a button on the Admin form that I click that runs this code, to bring back the Development environment so I can work.

CODE
Private Sub btnRestoreTools_Click()
Dim q As Integer
On Error GoTo btnRestoreTools_Click_Err
If MemUserLevel = 5 Then
  DoCmd.SelectObject acTable, "MSysObjects", True
  DoCmd.ShowToolbar "Ribbon", acToolbarYes
  Application.SetOption "Show Status Bar", True
  For q = 1 To CommandBars.Count
    CommandBars(q).Enabled = True
  Next q
End If
btnRestoreTools_Click_Exit:
  Exit Sub

btnRestoreTools_Click_Err:
  If Err = 2544 Then
    Resume Next
  Else
    MsgBox Error$
    Resume btnRestoreTools_Click_Exit
  End If
End Sub


Takes me two mouse clicks though. Holding down shift works with this method to. But you then need to run the main form manualy, so there is little point.

--------------------
Live to Surf
Go to the top of the page
 
Patty2
post Jun 30 2017, 08:39 AM
Post#11



Posts: 402
Joined: 10-August 08



Thank you all for you time and expert help,
But you have missunderstood my objective.......
I already put the code to "no" and now I just want to know how to get back to the codes to undo it
when now there is no toolbar to access the codes.
I just want to undo , put to "yes", but I can't get to the codes by way of the toolbar,
I do not need to know how to make the toolbar unavailable ( it already is!)
But thank you, after I get this undone then I will try your suggestions instead.
Go to the top of the page
 
theDBguy
post Jun 30 2017, 09:53 AM
Post#12


Access Wiki and Forums Moderator
Posts: 71,013
Joined: 19-June 07
From: SunnySandyEggo


Hi Patty,

Did you try my suggestion to create an Autokeys macro to get the Ribbon back? Just curious...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
BuzyG
post Jul 3 2017, 02:27 AM
Post#13



Posts: 331
Joined: 20-September 12
From: Cornwall UK


Patty

Reading you reply above I'm not sure you can get into your code from the shift key.

Click on your main form.

Press the RMB and select "Design View" for the form.

Press the RMB again and select "Form Proberties"

Click on the "Events" Tab of the properties.

Go down to the On "Open" event and click on the "..." on the far right, this will ask if you choose a build method. You can now select build a macro or a VBA code module and create a button on the form, where you can place you code.

CODE
DoCmd.ShowToolbar "Ribbon", acToolbarYes


Then when you click on the button, it should bring back the ribbon each time.
This post has been edited by BuzyG: Jul 3 2017, 03:15 AM

--------------------
Live to Surf
Go to the top of the page
 
kide
post Nov 8 2017, 04:34 AM
Post#14



Posts: 1
Joined: 29-December 16



Thanks BuzyG, you code worked perfectly for me!
Go to the top of the page
 
JonSmith
post Nov 8 2017, 07:44 AM
Post#15



Posts: 3,138
Joined: 19-October 10



Unless I am missing something (I didn't read it all) but try pressing Alt+F11
That should open the 'code window' regardless of the ribbon status.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th November 2017 - 05:34 AM