473,396 Members | 1,827 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,396 software developers and data experts.

Closing Ribbon With VBA In Access

I am trying to close the ribbon in my Access application so that the user will not have it available. I used the following code I found in a previous answer on this site.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.ShowToolbar "Ribbon", acToolbarNo
Interestingly enough, it worked exactly two times correctly and then stopped working.

Any ideas on why it stopped working? Has anyone else had this happen?

Thanks.
Dec 20 '11 #1
3 4265
tuxalot
200 100+
I use the same code to close the ribbon. The code here removes the left navigation bar also. Works every time for me.

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.ShowToolbar "Ribbon", acToolbarNo
  2.     DoCmd.SelectObject acTable, , True
  3.     DoCmd.RunCommand acCmdWindowHide
Re-enable with this:

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.ShowToolbar "Ribbon", acToolbarYes
  2.     DoCmd.SelectObject acTable, , True
  3.     DoCmd.SelectObject acForm, Me.Name
Dec 21 '11 #2
TheSmileyCoder
2,322 Expert Mod 2GB
You need to be more exact when you say "stopped" working.

When debugging, (and Before posting), always start by making absolutely sure that your code is run. You can look in our Access insights section for some articles on debugging in VBA, but a simply way for a "novice" is to simply add a msgbox preceeding the statement in question:
Expand|Select|Wrap|Line Numbers
  1. MsgBox "About to turn off Ribbon"
  2. DoCmd.ShowToolbar "Ribbon", acToolbarNo

The reason I bring this up, is that from what little information you have given, my best guess is that your code is simply not firing/executing.
Dec 21 '11 #3
NeoPa
32,556 Expert Mod 16PB
These may help :
Dec 21 '11 #4

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

Similar topics

1
by: u7djo | last post by:
Hi, I'm currently building a function in Access that creates an Excel spreadsheet but it doesn't look like the Excel object is being destroyed correctly as the Excel module is still showing in the...
22
by: alecjames1 | last post by:
I have a form which the user must complete before closing. I have disabled the window x button and use my own exit button. When selected it checks to see if the user has completed the entries...
1
by: Vegar Hansen | last post by:
Hello everone. Can somebody help me? When I run my code I can read, write to and delete from database, but when I have done one of these things and try to copy the databasefile from my folder...
1
by: spicyz | last post by:
I'm receiving an exception when my webmethod exits after opening/closing an Access database. I can reproduce this easily enough by creating a new default ASP .NET Web Service in VS.NET 2003. ...
6
by: news.microsoft.com | last post by:
Hope someone can help Working Visual Web Developer 2005 using Access databases It all works fine using the WebDevelopers webserver but when I use IIS I get these errors The Microsoft Jet...
3
by: rlntemp-gng | last post by:
RE: Access 2003/Excel 2003 Problem: After I close the Access application completely, I go out to the Task Manager and there is an Excel.exe object still sitting out there. My Access...
9
by: anthony | last post by:
In Access 2007, why does a query field designed as Term: ! ! return 00:00:00 when cboTerm actually contains 08SP. This works as expected in Access 2003?
6
by: scott.tang | last post by:
I'm experiencing a very strange problem. My application is MS Access front-end and MS SQL server back-end database. I have a SQL statement that deletes records from a table after an export...
4
by: peter1952 | last post by:
I would like to automate closing an Access 2003 database at the end of running a macro. How can I do this?
1
by: TroyLad | last post by:
I want to confirm with the user that they have printed a report when they click on the close button of a previewed report. If they choose not to close (in answering my msgbox) I would like to not...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.