Solved

Access 2010 Macro

Posted on 2014-03-26
8
797 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
 

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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 …

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now