Solved

Access 2010 Macro

Posted on 2014-03-26
8
799 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
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 500 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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