[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access 2010 Macro

Posted on 2014-03-26
8
Medium Priority
?
810 Views
Last Modified: 2014-03-28
Hi

Still learning to use Access 2010 no problem with 2003.
Macros
I want to add two lines to a 2010 Macro RunCode and HideRibbon(). I have added the line HideRibbon() but can't seem to be able to edit and Add the line RunCode.
Any help appreciated

chestera
0
Comment
Question by:chestera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39958466
Can you post a sample copy of your database?

RunCode is definitely an option in Access 2010 accdb/mdb file.

(Guessing that it is NOT an option in Web Projects, however)
0
 

Author Comment

by:chestera
ID: 39958559
mbizup

I have been doing some research and have bypassed the autoexec and put the following code in my startup  form
docmd.showtoolbar "Ribbon", acToolbarNo. this works fine and is simple.

Alan
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39958576
VBA is my own preferred approach over Macros.  Glad you've got it worked out.

Curious what was going wrong with your macro though... it *should* work.  The general approach is to have a public function:

Public Function HideRibbon()
    docmd.showtoolbar "Ribbon", acToolbarNo
End Function

Open in new window


And then add a RunCode line to your autoExec Macro to call that function.

You do need the custom public function, since HideRibbon is not a native command, and it does need to be a function (not a sub).
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chestera
ID: 39960486
mbizup

My problem with the Macro I initially entered the Function call HideRibbon() but the I realized I hadn't enter the RunCode line and I didn't know how to add the line. Is there away to remove the Home Ribbon Menu when running the mde or aade rather than hide I have the old access2003 dropdown menu's and hidding the Home Ribbon leaves a large gap

Alan
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 39961126
Alan,

For that, you would have to customize the Access ribbon, which is completely different from customizing the Access 2003/earlier command bars.

Ribbon customization is a huge topic, but to get you started...

Ribbons are XML based, and customization involves in its simplest form creating and customizing a dedicated table for the XML markup.  There are a couple of approaches - one is to start with the default Access Ribbon, and remove/hide what you don't need.  The other is to start fresh and *add* only what you need to the ribbon (which is probably the easiest way to do what you're asking).  For this approach, remember to use the "Start From Scratch" option in the XML.

The following should get you going in the right direction (or at least help you decide whether or not it is worth the effort).

A tool for customizing ribbons.  I cant vouch for this, but other regulars here love it.:
http://www.ribboncreator2010.de/en/

For a 'Do it Yourself' approach...
This is a thorough tutorial to get you started with basic ribbons:
http://office.microsoft.com/en-us/access-help/customize-the-ribbon-HA010211415.aspx

This covers just about everything you need to know about ribbons, and is a great resource (but best AFTER you have learned the basics of ribbon customization):
http://www.accessribbon.de/en/

Ribbon customization can be involved/complicated, but it is worth learning in the long run.
0
 

Author Comment

by:chestera
ID: 39961166
mbizup

Thank you very much for all your help most appreciated

Alan
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39961172
Here is a sample that you can dig into  - an incomplete invoicing database, with a partially complete custom ribbon.

The main things to look into

- Table: USysRibbons --- You might need to set your copy of Access to show system objects to see this table

-  modRibbons -- Module of VBA callback functions that affect the ribbon

-  Code in the various forms (Open Events, if I remember correctly) that call those functions
DatabaseDevelopment.accdb
0
 

Author Comment

by:chestera
ID: 39962907
mbizup

Thank you. I now have a wealth of info

All the best

Alan
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question