Solved

Access97/Transfer Menubar

Posted on 1997-12-22
2
231 Views
Last Modified: 2008-03-06
I am working in Access 97 and I have created a function that will query records based on user input and then create a new database.  I then export the new querydef and data as a table to the new database using the TransferDatabase method.  I am also exporting a report to the new database.  This report uses a custom menubar.  My problem is this; when I export the report, the menubar does not go with it.  Is there a way to transfer a menubar that is not a macro?  I know it can be done from an open database using the 'Get External Data' selection from the file menu.  But I need to export not import.  Any suggestions?
0
Comment
Question by:STKeith
2 Comments
 

Accepted Solution

by:
mikeeec earned 100 total points
ID: 1963457
I do not know of any way to directly export a custom menubar.  I think the best solution would be to use the CommandBars.Add method, along with the necessary code to completely recreate your menubar in the new database.  This should be fairly straightforward, because you can simply copy the appropriate commands and code from the menubar you have already created.  The initial code would be written as follows:

Set MyNewMenu = CommandBars.Add(Name:="MyMenu", Position:=msoBarRight, MenuBar:=True)
With MyNewMenu
     .Protection = msoBarNoMove
     .Visible = True
End With
 Then, simply use the Add method to add your custom controls to the newly created menubar.
0
 

Author Comment

by:STKeith
ID: 1963458
Thanks mikeeec.  This sounds like it will do the trick.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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