Solved

Access 2010 Macro

Posted on 2014-03-26
8
802 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

726 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